tags:

views:

95

answers:

3

This is a continuation of this thread: http://stackoverflow.com/questions/2358546/div-borders-affecting-padding. I've got the text aligned like I want, but now I need to hide the black line that is below the active tab - like this http://i.imgur.com/jYMhP.png

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

Source:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head>
    <meta name="generator" content=
    "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org" />
    <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="http://joe-riggs.com/chip/style.css" />

  </head>
  <body> 
    <div class="top-margin"></div>
    <div class="main">
      <div class="top">
        <div class="logo">
        <a href="http://joe-riggs.com/chip"&gt;&lt;img class="logo-link" src="http://joe-riggs.com/chip/images/logo.jpg" alt="logo" height="125px" width="250px" /></a>

        </div>
        <div class="nav-links" id="nav-links">
          <ul id="nav">

            <li class="filler-left"><a href="#">&nbsp;</a>
            </li>
            <li class="about-active"><a href="http://joe-riggs.com/chip/"&gt;About&lt;/a&gt;
            </li>
            <li class="process"><a href="http://joe-riggs.com/chip/process"&gt;Process&lt;/a&gt;

            </li>
            <li class="projects"><a href="http://joe-riggs.com/chip/projects"&gt;Projects&lt;/a&gt;
            </li>
            <li class="contact"><a href="http://joe-riggs.com/chip/contact"&gt;Contact&lt;/a&gt;
            </li>
            <li class="filler"><a href="#">&nbsp;</a>
            </li>
          </ul>

        </div>
      </div>

      <div class="left">
        <ul>
            <li>Links</li>
        </ul>
      </div>
      <div class="content">

      <img src="images/architect.png" alt="me" style="float:left; padding-right:10px;" />
       So this is the main page - the first page people will see when they come
       to your page.  A general overview would be nice.  This text
       can go over top of a faded background picture too.
       <br />
      <br />
        Donec velit nibh, pellentesque in fringilla a, blandit id nibh. Class
        aptent taciti sociosqu ad litora torquent per conubia nostra, per
        inceptos himenaeos. Nam posuere mattis velit eget rhoncus. Maecenas
        bibendum tristique dolor, nec varius nulla porta eget. Aenean turpis
        ligula, ornare in consectetur vitae, aliquet id nulla. Vivamus bibendum
        sapien id neque lacinia vel viverra ante luctus. Sed lacinia velit id
        diam vulputate sollicitudin. Integer viverra libero vel enim dapibus
        rutrum. Praesent vel ipsum tortor. Pellentesque porttitor ante sed
        felis pretium nec rhoncus eros lacinia. Nam a massa nec sapien eleifend
        condimentum. Fusce ut augue id libero condimentum facilisis.<br />
        <br />
        Donec metus turpis, aliquet euismod tempor ut, vehicula condimentum
        odio. Morbi vulputate imperdiet nibh et porta. Etiam et nulla est, ut
        rhoncus nisi. Mauris eleifend lectus nunc, eu elementum odio. Aliquam
        erat volutpat. Morbi et dolor sit amet enim malesuada pretium sed quis
        odio. Vivamus convallis aliquam massa, blandit vehicula justo consequat
        in. Sed imperdiet rutrum volutpat. Nunc dignissim aliquet mattis. Lorem
        ipsum dolor sit amet, consectetur adipiscing elit. Mauris arcu quam,
        euismod ut porttitor non, lobortis vitae massa. Aliquam venenatis purus
        id mauris consequat vel luctus quam vulputate. Duis in neque libero.
        Aenean pretium pharetra justo vel dapibus. Donec risus felis, facilisis
        in vestibulum sit amet, tincidunt sit amet tellus. Donec ullamcorper
        euismod lacus id pulvinar.<br />
        <br />

        Donec metus turpis, aliquet euismod tempor ut, vehicula condimentum
        odio. Morbi vulputate imperdiet nibh et porta. Etiam et nulla est, ut
        rhoncus nisi. Mauris eleifend lectus nunc, eu elementum odio. Aliquam
        erat volutpat. Morbi et dolor sit amet enim malesuada pretium sed quis
        odio. Vivamus convallis aliquam massa, blandit vehicula justo consequat
        in. Sed imperdiet rutrum volutpat. Nunc dignissim aliquet mattis. Lorem
        ipsum dolor sit amet, consectetur adipiscing elit. Mauris arcu quam,
        euismod ut porttitor non, lobortis vitae massa. Aliquam venenatis purus
        id mauris consequat vel luctus quam vulputate. Duis in neque libero.
        Aenean pretium pharetra justo vel dapibus. Donec risus felis, facilisis
        in vestibulum sit amet, tincidunt sit amet tellus. Donec ullamcorper
        euismod lacus id pulvinar.
      </div>
    <div class="footer">
    <br />
    copyright &copy; 2010
    </div>
    </div><!--main-->
  </body>
</html>

    html,body{margin:0}

    body {
        font-family: "Lucida Grande", Verdana, "Trebuchet MS", Helvetica, Arial, sans-serif;
        font-size: 100%;
        line-height: 140%;
        color: #333333;
        background-color: #eee;
        }

    div.content {
        font-size: 80%;
        background-color: #FFFFFF;
        margin-left:200px;
        padding:15px;
        }

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

    div.top{
        /*border-bottom: 1px solid #000;*/ 
        width:100%;
        position: relative;
        }

    div.left{
        float:left;
        width:200px;
        height:770px;
        border-right: 1px solid #000;
        font-size: 80%;
        padding-top:20px;
        }

    div.body{
        height: 770px;
        background-color: #FFFFFF;
        /*margin: 5px 5px 5px 5px;*/
        padding: 6px;
        font-size: 90%;
        }

    div.logo{
        height:125px;
        width:250px;
        border-right: 1px solid #000;
        /*border-bottom: 1px solid #000;*/
        }

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

    div.nav-links{
        float:right;
        position: absolute;
        bottom: 0;
      /*  margin-left:250px;*/
        margin-bottom: 0px;
        width:100%;
        border-bottom: solid 1px black;

        }

    div.header-link{
        display:inline;
        margin:0 30px 0 0;
        }

   .logo-link{
        border-style: none;
        }

    div#nav-links ul li {
        float:left;
        overflow:hidden;
        position:relative;
        padding-left:15px;
        padding-right:15px;
        /*border-bottom: dotted 1px black;*/
        /*border-top: solid 1px #EEE;*/ 
        text-align:left;
 border-top: solid 1px transparent; border-right: solid 1px transparent; border-left: solid 1px transparent;

        }


    ul#nav li.about-active {

        border-left: solid 1px black;
        border-top: solid 1px black;
        border-right: solid 1px black;
        border-bottom: solid 1px white;
        background-color:white;
        }


    ul#nav li.process-active {

        border-left: solid 1px black;
        border-top: solid 1px black;
        border-right: solid 1px black;
        background-color:white;
        border-bottom: solid 1px white;
        height:22px;

        }

    ul#nav li.projects-active {


        border-left: solid 1px black;
        border-top: solid 1px black;
        border-right: solid 1px black;
        background-color:white;
        border-bottom: solid 1px white;
        height:22px;
        }

    ul#nav li.contact-active {

        border-left: solid 1px black;
        border-top: solid 1px black;
        border-right: solid 1px black;
        background-color:white;
        border-bottom: solid 1px white;
        height:22px;        
        }

    ul#nav li.about {

        /*border-bottom: solid 1px black;*/
        }

    ul#nav li.process {
        /*width:110px;*/

    /*  border-bottom: solid 1px black;*/

        }

    ul#nav li.projects {
        /*width:110px;*/

    /*  border-bottom: solid 1px black;*/
        }

    ul#nav li.contact {
        /*width:110px;*/

        /*border-bottom: solid 1px black;*/
        }

        ul#nav li.filler-left { 
        /*border-bottom: solid 1px black;*/
                border-left: solid 1px black;
        border-top: solid 1px transparent;
        padding-left:311px;
        margin-left:210px;
        /*width:305px;*/

        }

        ul#nav li.filler {  
        padding-right:20px;
        /*border-bottom: solid 1px black;*/
        /*width:10%;*/
        width:25px;
        }



    ul#nav a {
        text-decoration: none;
        }

    ul#nav a:hover {    
        text-decoration: none;
        color:blue;
        }

    div.footer{
        float:right;
        font-size: 70%;
        }
A: 
.about-active
{
    position: relative;
    bottom: -1px;
}
F.Aquino
Hi this works, but then it re-creates the problem I just fixed - It pushes the text down 1 pixel when the link is active then pops back up when the next link is clicked. How do I fix that?
jriggs
Ah, @jriggs, see my posted answer as you must have been typing the comment... =)
David Thomas
+2  A: 

Similarly to F.Aquino's answer, the simplest solution is, almost certainly, moving your .about-active to cover the border. I'd personally do it this way, though:

.about-active  {
    padding-bottom: 1px;
    margin-bottom: -1px;
 }

the padding-bottom forces the text inside the .about-active element up by one pixel (the width of the border you're trying to cover, and the margin-bottom: -1px; pulls the shape down by 1px, the idea being that this way the text maintains its horizontal alignment with the remaining list elements.

But either way would work just as well.

David Thomas
ty sir! css is so frustrating at times, nothing I searched even mentioned this, learning every day.
jriggs
You'll get there; the trick with CSS is to work out the box-model -use Firebug, or Chrome's Developer Tools, IE web-developer toolbar (I think...) or Opera's Dragonfly- and then it starts to make more sense. Code for a sane browser first, and don't drink until *after* you've finished with IE (for the day, at least...) =)
David Thomas
+3  A: 

To add on to ricebowl's answer,

You can merge all 4 of these selectors into one.

Change the class attribute for each menu tab li from 'menuName-active' to 'menuName active'. Using the space instead of the - gives the element a 'menuName' class and an 'active' class. The element will no longer have a 'menuName-active' class.

Since each menu tab uses the same styles you can use this one selector:

ul#nav li.active{
   background-color:white;
   border-color:black black white;
   border-style:solid;
   border-width:1px;
   height:22px;
   margin-bottom:-1px;
   padding-bottom:1px;
}
SomewhereThere
That's a good point, but, while I am up-voting the answer (welcome to Stackoverflow!), I'll offer that the OP might've used this form for a reason.
David Thomas
Actually, I'm quite new to coding css from scratch so I didnt even realize this was an option - its funny how close the naming is. Right now I'm parsing the uri (php) and using script logic to set the class. This method may be preferable (more efficient) if I can get it working. I really appreciate pointers like this as I learn new tehniques.
jriggs
I tried this method with no joy, can you expand a bit, thanks
jriggs