Issues with CSS sliding doors

Discussion in 'CSS' started by pradeep.balua, Jan 31, 2009.

  1. #1
    Hi guys I am a newbie learning css and I am right now learning the css sliding doors technique and I have come across some problem . In the CSS sliding doors article Douglas bowman changes the padding of the list element on the left with 9px and then decreases the anchor-left padding to 6px from 15 px and then makes a comment
    What I can't understand is when you add a left-padding to the list element how can the inner edges of the visible doorways butt up against each other? I am not getting that point. If somebody can help me with this I will be very glad.
    #header li {
        float:left;
        background:url("right.gif")
          no-repeat right top;
        margin:0;
        padding:0 0 0 9px;
        }
      #header a {
        display:block;
        background:url("left.gif")
          no-repeat left top;
        padding:5px 15px 4px 6px;
        }
    HTML:
    below I will give the full code he has used
     <div id="header">
        <ul>
          <li><a href="#">Home</a></li>
          <li id="current"><a href="#">News</a></li>
          <li><a href="#">Products</a></li>
          <li><a href="#">About</a></li>
          <li><a href="#">Contact</a></li>
        </ul>
      </div>
    Code (markup):
    
     #header {
        float:left;
        width:100%;
        background:#DAE0D2 url("bg.gif")
          repeat-x bottom;
        font-size:93%;
        line-height:normal;
        }
      #header ul {
        margin:0;
        padding:10px 10px 0;
        list-style:none;
        }
    
    #header li {
        float:left;
        background:url("left.gif")
          no-repeat left top;
        margin:0;
        padding:0 0 0 9px;
        }
      #header a, #header strong, #header span {
        display:block;
        background:url("right.gif")
          no-repeat right top;
        padding:5px 15px 4px 6px;
        }
      #header #current {
        background-image:url("left_on.gif");
        }
      #header #current a {
        background-image:url("right_on.gif");
        padding-bottom:5px;
        }
    Code (markup):

     
    pradeep.balua, Jan 31, 2009 IP