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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: CSS Help

  1. #1
    Join Date
    Apr 2008
    Location
    Derby
    Posts
    4,668
    Tokens
    262

    Latest Awards:

    Default CSS Help

    Right, I've only just begun coding very basic CSS. And i was wondering whether anyone could help me.


    How do I position two div's so that they are on top of each other e.g

    theres a navigation box and another underneath?

    Thanks for any help! +rep!

    =]
    Back for a while

  2. #2
    Join Date
    Apr 2008
    Location
    Derby
    Posts
    4,668
    Tokens
    262

    Latest Awards:

    Default

    Bump. I really need this as soon as possible Would be extremely grateful to anyone!! =D!
    Back for a while

  3. #3
    Join Date
    Jul 2009
    Posts
    10
    Tokens
    0

    Default Hey

    You have asked quite a broad question considering xhtml and css development is usually based on nested structures.

    If you are using divs then in your xhtml should look something like...

    <div id="div1">
    <div id="div2">

    </div>
    </div>

    Div 2 is nested within (and in front of) div 1.

    Then you would then use css to style each of the 2 divs so that they are displayed how you want.

    You mentioned navigation menus, could you explain a little more what you are trying to achieve?

    Chris

  4. #4
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    erm. Well if u are just doing a div ontop of another div, to force it onto a "new line" you would use clear:both;

    But it's good to have a navigation container and have a width set on it, but i always use clear:both just incase.

  5. #5
    Join Date
    Apr 2008
    Location
    Derby
    Posts
    4,668
    Tokens
    262

    Latest Awards:

    Default

    [IMG][/IMG]

    Thats the sorta layout I want.... Just the layout not what I want it to look like. Trying to achieve using pure CSS
    Back for a while

  6. #6
    Join Date
    Jul 2009
    Posts
    10
    Tokens
    0

    Default Hey again

    I've got to go but I very quickly made a template based on your image, although this structure was used on the link I showed you. Its very rough and would need work i.e the widths, heights etc

    Save this as index.htm

    <html>
    <head>
    <style type="text/css">
    #wrapper{
    padding:10px;
    width:1000px;
    height:1000px;
    border:1px solid black;
    }
    #left{
    floateft;
    width:300px;
    height:1000px;
    }
    #right{
    width:674px;
    height:1000px;
    border:1px solid black;
    }
    #upper{
    width:290px;
    height:200px;
    border:1px solid black;
    }
    #lower{
    margin-top: 10px;
    width:290px;
    height:790px;
    border:1px solid black;
    }

    </style>
    </head>
    <body>
    <div id="wrapper">
    <div id="left">
    <div id="upper">
    </div>
    <div id="lower">
    </div>
    </div>
    <div id="right">
    </div>
    </div>
    </body>
    </html>

  7. #7
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    A good idea would be to do something like

    Code:
    <div id="left">
        Content for left.
    </div>
    
    <div id="right">
    </div>
    And float left both of them and set a width on them. Then inside them u can have, for instance "navHeader" and set clear:both that to dodge potential side elements (but it obviously won't dodge the right div, the navHeader will only dodge the stuff in it's parent div.

  8. #8
    Join Date
    Apr 2008
    Location
    Derby
    Posts
    4,668
    Tokens
    262

    Latest Awards:

    Default

    hmmm.... Now I've done that but the like second box (the one underneath the small one) just goes to the right of small one, How would I make it go underneath without it ruining the big content one? =D
    Back for a while

  9. #9
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Obulus View Post
    hmmm.... Now I've done that but the like second box (the one underneath the small one) just goes to the right of small one, How would I make it go underneath without it ruining the big content one? =D
    clear:both ?

  10. #10

    Default

    I'd say (based on my low CSS knowledge...)

    Code:
    <div id="wrapper">
    
         <div id="left_wrapper">
              
              <div id="left_top"></div>
              <div id="left_bottom"></div>
              
         </div>
    
         <div id="right_wrapper">
              
              <div id="right_content">
                   
              </div>
              
         </div>
         
    </div>
    Then float right_wrapper right, left wrapper left, and clear: both; the left_bottom.

Page 1 of 2 12 LastLast

Posting Permissions

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