DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   css tabs formation problem (http://www.daniweb.com/forums/thread197117.html)

marjan_m Jun 11th, 2009 1:19 pm
css tabs formation problem
 
2 Attachment(s)
Hi,

I am trying to create tabs using two images, the main background image and then the mouse over image, code i hv written after reading guidelines from a book so thats why cant completly understand where is the problem:

css code:

body {
font: 62.5%/1.5 Verdana, Arial, Helvetica, sans-serif;
background-color:#E5E5E5;
}

#content {
border-top: 1px solid #898989;
border-right: 1px solid #898989;
border-bottom: 1px solid #898989;
border-left: 1px solid #898989;
}

#navContainer {

font: 1.1em Arial, Helvetica, sans-serif;
text-align: center;
padding: 20px 0 0;
}

#navigation
{
padding:0px;
}

#navigation a:link {
text-transform: uppercase;
text-decoration: none;
padding: 5px 10px;
position: relative;
margin-right: 5px;
}

#navigation a:visited {
text-transform: uppercase;
text-decoration: none;
padding: 5px 10px;
position: relative;

}

#navigation #contactDetailsPageLink a:link, #navigation
#contactDetailsPageLink a:visited {
margin-right: 0;
}
<!-- to change font color of links-->
#navigation a:visited {
color:#CCCCCC;


}
#navigation a:hover {
background-image:url(tab-hover.JPG);
color:#FFFFFF;
}


#navigation ul {
list-style: none;
margin-bottom:5px;

}

#navigation li {
display: inline;
padding: 0px 9px;
background-image:url(main_tab.JPG);
}

#navigation a:active {
color:#FFFFFF;
}

#wrapper {
margin-top:0px;
margin-left:95px;
}
</style>

Html code is:


<body id="homepage">

<div id="navContainer">
<div id="navigation">
<ul>
    <li id="pro"><a href="#" onClick="chk('pro')">Provinces</a></li>
               
      <li id="loc"><a href="#" onClick="chk('loc')">Locations</a></li>
               
      <li id="slide"><a href="#" onClick="chk('slideshow')">Slide Show</a> </li>
               
      <li id="users"><a href="#" onClick="chk('users'">Users</a></li>
                </ul>
        </div>
</div>


<div id="wrapper">
        <iframe height="1000" width="800" id="content" scrolling="no" frameborder="0">
        </iframe>
</div>
</body>

I have attached the two images also. First the problem is that there should not be any space between the tabs, and secondly the tab-hover image is not accurate.

Please guide
Thanks

drumichael87 Jun 12th, 2009 1:57 pm
Re: css tabs formation problem
 
#navigation li {
has right padding set. there's your space. It would be better if we could see the page in action.

sreein1986 Jun 13th, 2009 2:08 am
Re: css tabs formation problem
 
take the padding total to 0 pixel


All times are GMT -4. The time now is 8:22 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC