...

View Full Version : linking file to css file not working?



coolioi
01-10-2010, 01:54 PM
I am trying to link the html file to the css file

The code below is in a file called menu.css

/*----------------------------------- */
/*---------- Menu ------------ */
/*----------------------------------- */

#tabsI {
float:left;
width:100%;
background: inherit;
font-size:93%;
line-height:normal;
border-bottom:1px solid #DD740B;
}
#tabsI ul {
margin:0;
padding:10px 10px 0 50px;
list-style:none;
}
#tabsI li {
display:inline;
margin:0;
padding:0;
}
#tabsI a {
float:left;
background:url("images/tableftI.gif") no-repeat left top;
margin:0;
padding:0 0 0 5px;
text-decoration:none;
}

#tabsI a span {
float:left;
display:block;
background:url("images/tabrightI.gif") no-repeat right top;
padding:5px 15px 4px 6px;
color:#FFF;
}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
#tabsI a span {float:none;}
/* End IE5-Mac hack */
#tabsI a:hover span {
color:#FFF;
}
#tabsI a:hover {
background-position:0% -42px;
}
#tabsI a:hover span {
background-position:100% -42px;
}

#tabsI a.selected {
background: url('images/lefts.gif') no-repeat left top;
}

#tabsI a.selected span {
background:url("images/rights.gif") no-repeat right top;

}

-------------------------
This is the code for my html file

For some weird reason the link href written in blue isnt working,

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>menu test</title>
<link href="css/menu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/menus.js"></script>

</head>

<body>
<div id="tabsI">
<ul>
<li><a onclick="applySelectedTo(this);return false;" href="#" class="selected" title="Link 1"><span>Home</span></a></li>
<li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 2"><span>Link 2</span></a></li>
<li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 3"><span>Link 3</span></a></li>
<li><a onclick="applySelectedTo(this);return false;" href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
<li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 5"><span>Link 5</span></a></li>
<li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 6"><span>Link 6</span></a></li>
<li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 7"><span>Link 7</span></a></li>
</ul>
</div>

</body>

</html>

just to inform you all, I have tested the css code in my html file so it is working, just went im trying to link them its not!

Thanx for the help

Apostropartheid
01-10-2010, 06:54 PM
Do you mean the images aren't working? That's because you're referencing images that should be under css/images, which I presume they're not. Use "../images/" instead, making the browser go up a directory.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum