tags:

views:

403

answers:

3

This is the page: http://joe-riggs.com/chip/

Im developing with FF havent even tried to fix ie yet, I want the nav links to be at the bottom, like this: http://i.imgur.com/cYERA.png

At some point I want to add the black lines,they are just there for reference. Thanks-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head>
    <meta name="generator" content="" />
    <title>
      NCB
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <!--link type="text/css" rel="stylesheet" href="style.css"-->

    <style type="text/css">
/*<![CDATA[*/

    html,body{margin:0}

    div.top-margin{
    height: 15px ;
    background-color:red;
    }

    div.top{
    width:95%;
    height: 125px;
    }

    div.left{
    float:left;
    width:100px;
    }

    div.body{
    width:95%;
    height: 125px;
    }

    div.logo{
    height:100px;
    width:100px;
    background-color:red;
    float:left;
    }


    div.main{
    width: 900px ;
    margin-left: auto ;
    margin-right: auto ;
    }

    div.nav-links{
    height:100px;
    /*float:right;*/
    border: .2em dotted #900; 

    }

    div.header-link{
    display:inline;
    height:100%;
    margin:0 30px 0 0;


    }

    /*]]>*/
    </style>
  </head>
  <body>
    <div class="top-margin"></div>
    <div class="main">
      <div class="top">
        <div class="logo"></div>
        <div class="nav-links">
          <div class="header-link">
            About
          </div>
          <div class="header-link">
            Process
          </div>
          <div class="header-link">
            Portfolio
          </div>
          <div class="header-link">
            Contact
          </div>
        </div>
      </div>
      <div class="left">
        left
      </div>
      <div class="body">
        body
      </div>
    </div><!--main-->
  </body>
</html>
+6  A: 

You can position an element relatively to its parent as follows:

.top {
    position: relative;
}
.nav_links {
    position: absolute;
    bottom: 0;
}

Bottom is the distance from the parent element (.top in this case).

You also need to remove or reduce the value of the height property for .nav_links element to achieve the effect in the image.

David Caunt
Hi, I made the changes, now the nav links div is below the logo. Did I miss something?
jriggs
Ok got it looking close by increasing the nav div left-margin. Can you let me know if you see anything blatantly stupid in what I have?
jriggs
A: 

How about:

div.header-link {
    float: left;
    margin: 0 30px;
    padding-top: 75px;
}

You can refine your margins per item to get them where you want them.

bmoeskau
Not necessary with relative/absolute positioning, where the element is truly positioned at the bottom, rather than just given the right amount of padding or margin to give distance from the top. If the parent element is to grow, through redesign or content flow, these margins need to be adjusted which is more work to maintain and may be impossible if the size is dynamic.
David Caunt
That only works so long as the box stays the same height. Positioning is the way to go.
Tom
Thanks for the "exaplanation" but I don't see how this is a wrong/negative point answer. One thing you did not mention is that with abs positioning you also have to set every single left or right coordinate, which would also have to change if the layout changed. How is that easier to maintain? There are many times when using padding/margins would be the "way to go" -- it depends on the situation. Geez.
bmoeskau
Please note that I did *not* downvote your post - that's not how Stack Overflow should work, and it's not how I behave. Further, your answer is not wrong, but I believe it is a less maintainable solution. With the navigation container element positioned at bottom left, it will always be pinned to the bottom left of the header, even if the header is made taller or shorter.
David Caunt
OK, point taken. So someone else down-voted a perfectly reasonable and valid answer (regardless of whether it is the "best" one in their opinion) for no good reason. The way voting and reputation works on this site really irritates me at times.
bmoeskau
A: 

The answer is....:

div.nav-links {
  border:0.2em dotted #990000;
  padding-left:50%;
  padding-top:9%;
}

will also recommend Firebug for this kind of work, took me like 10seconds to solve this puzzle ;p

Daniel T. Magnusson