Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2008
    Posts
    581
    Tokens
    75

    Default Dumb HTML question [+ REP]

    I want to make a image center of my page.
    Not the top center but middle center.
    Like a coming soon page.
    And i want to add a background color to it.

    Can someone give me the whole code including the html tags from top to bottom?

    Thanks +REP

    P.S. I know its dumb haha

    Vouch
    [x] [x] [x] [x] [x]


  2. #2
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:


  3. #3
    Join Date
    Oct 2008
    Posts
    581
    Tokens
    75

    Default

    I'm a coding dummie.
    Can you explain how i use this in HTML?

    Vouch
    [x] [x] [x] [x] [x]


  4. #4
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by Madox View Post
    I'm a coding dummie.
    Can you explain how i use this in HTML?
    HTML Code:
    <html>
    <head>
    <title>Title</title>
    
    <style type="text/css">
    body
    {
        background-color: #FFFFFF;
    }
    
    #centerImage
    {
        position: fixed;
        top: 50%;
        left: 50%;
        margin-top: -50px;
        margin-left: -100px;
    }
    </style>
    </head>
    <body>
    
    <img src="URL OF THE IMAGE" id="centerImage" />
    
    </body>
    </html>
    Replace the '#FFFFFF' with the colour you want the background to be.
    Replace the '-50px' and the '-100px' with the correct numbers for your image (half of the height and half of the width)
    Replace the "URL OF THE IMAGE" with the url of the image, obviously.

    Completely untested and barely even read over to check it, but it should work.

  5. #5
    Join Date
    Oct 2008
    Posts
    581
    Tokens
    75

    Default

    It doesn't center properly

    Vouch
    [x] [x] [x] [x] [x]


  6. #6
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by Madox View Post
    It doesn't center properly
    Screenshot?

  7. #7
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Get rid of everything I said before, just do this, it's simpler.

    HTML Code:
    <html>
    <head>Title</head>
    
    <style type="text/css">
    body
    {
        background-color: #FFFFFF;
    }
    
    #centerImage
    {
        height: 100%;
        width: 100%;
        background: url(1.png) no-repeat center center;
    }
    </style>
    
    <body>
    
    <div id="centerImage">&nbsp;</div>
    
    </body>
    </html>
    Last edited by Trinity; 08-07-2011 at 12:57 AM.

  8. #8
    Join Date
    Oct 2008
    Posts
    581
    Tokens
    75

    Default

    A** Thanks very much!!

    Vouch
    [x] [x] [x] [x] [x]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •