treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[SOLVED]Simple CSS query.

  • Guyz I'm just new to the forums and I'm just a noobie when it comes to CSS. I have a query about positioning. http://i53.tinypic.com/29vjvj6.jpg
    I don't know how to get the "Header" below the links because the list is floated to the left. Any tips please?
  • Do you have any html/css so far that you can show us? It might make helping you a bit easier, you wouldn't want us to do all the work now would you ;)

    Looking at your picture though, I think this is just a html thing.. just put the header div below the navigation list, something like this?

    <div id="title">...title things go here...</div>
    <ul id="navigation">...your navigation bar</ul>
    <div id="header">...the header1 div</div>
  • Looks like you want to put the header at the top, then place the title as a paragraph inside the header element and style the paragraph with css. Does that make sense?
  • I'm assuming that you're floating individual <li>s and the header below isn't clearing the float. If that's the case, use "clear:left" on the header element.
  • Thanks for the replies bob tobeeornot thomas. I know that i should be figuring this out by my self but i really appreciate the help. This is from a psd file so i actually cropped the title logo. but it seems i dont know how to put the header below the na links because if floated it to the left. Here is the code i am using.
    #header-page {
    marin:0px auto;
    width: 1400px;
    background-image:url(images/header.jpg);
    background-color:#11161c;
    height: 290px;

    }
    #header-page #header {
    margin:0px auto;/* center the div*/
    width: 960px;
    }

    #header ul li {
    display: block;
    float: left;
    margin-top: 150px;
    }

    #header ul li a {
    color: #FFF;
    font-family: "Myriad Pro";
    font-size: 12px;
    text-decoration:none;
    padding-left: 15px;
    }
  • @Thomas you got it. I tried clear:left and it worked. Thanks a lot!
    Actually i'm using two container tags because I don't know what to do with the background image of the header. The circular shine light is just too big so I cropped the whole picture and created a container different from the body. Can anyone also comment if what I'm doin is correct?