Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have fiew codes which work when Css is add in to html page, but not when in external css, other instructions in that css file work perfectly

sample of one of them css part


CSS
.animatedtabs{
border-bottom: 1px solid gray;
overflow: hidden;
width: 100%;
font-size: 14px; /*font of menu text*/
}


.animatedtabs ul{
list-style-type: none;
margin: 0;
margin-left: 10px; /*offset of first tab relative to page left edge*/
padding: 0;
}

.animatedtabs li{
float: left;
margin: 0;
padding: 0;
}

.animatedtabs a{
float: left;
position: relative;
top: 5px; /* 1) Number of pixels to protrude up for selected tab. Should equal (3) MINUS (2) below */
background: url(media/tab-blue-left.gif) no-repeat left top;
margin: 0;
margin-right: 3px; /*Spacing between each tab*/
padding: 0 0 0 9px;
text-decoration: none;

}

.animatedtabs a span{
float: left;
position: relative;
display: block;
background: url(media/tab-blue-right.gif) no-repeat right top;
padding: 5px 14px 3px 5px; /* 2) Padding within each tab. The 3rd value, or 3px, should equal (1) MINUS (3) */
font-weight: bold;
color: black;
}

/* Commented Backslash Hack hides rule from IE5-Mac \*/
.animatedtabs a span {float:none;}
/* End IE5-Mac hack */


.animatedtabs .selected a{
background-position: 0 -125px;
top: 0;
}

.animatedtabs .selected a span{
background-position: 100% -125px;
color: black;
padding-bottom: 8px; /* 3) Bottom padding of selected tab. Should equal (1) PLUS (2) above */
top: 0;
}

.animatedtabs a:hover{
background-position: 0% -125px;
top: 0;
}

.animatedtabs a:hover span{
background-position: 100% -125px;
padding-bottom: 8px; /* 3) Bottom padding of selected tab. Should equal (1) PLUS (2) above */
top: 0;
}



HTML
and now html part

<div class="animatedtabs">
<ul>
<li><a href="http://www.dynamicdrive.com" title="Home"><span>Home</span></a></li><li class="selected"><a href="http://www.dynamicdrive.com/style/" title="CSS Examples"><span>CSS</span></a></li><li><a href="http://www.dynamicdrive.com/new.htm" title="New"><span>New</span></a></li><li><a href="http://www.dynamicdrive.com/revised.htm" title="Revised"><span>Revised</span></a></li><li><a href="http://tools.dynamicdrive.com" title="Tools"><span>Tools</span></a></li>	
<li><a href="http://www.dynamicdrive.com/forums/" title="DHTML Forums"><span>Forums</span></a></li></ul>
</div>

What I do wrong? how to change that code to work in external?

What I have tried:

Remove style command from beginning and end of css, use separate file only for that css... and around for hours I am wrack...
Posted
Updated 1-Jul-18 7:06am
v2
Comments
Kornfeld Eliyahu Peter 1-Jul-18 9:51am    
It sounds you did not linked your external CSS to the HTML...
However, your post is so messy I can't tell that...
Member 13894047 1-Jul-18 10:01am    
I link them, the other codes in that folder work(like colors and other formatting)




<link rel = "stylesheet" type="text/css href = "../style/mystyle.css">
Krunal Rohit 2-Jul-18 0:20am    
You just need to understand the directory structure. Use the firebug in browser and edit the reference in realtime.


KR
ZurdoDev 2-Jul-18 12:58pm    
If the url to the css is correct then a different style is taking precedence. You'll have to use your developer tools in the browser to figure out what is happening.
ZurdoDev 2-Jul-18 12:58pm    
If the url to the css is correct then a different style is taking precedence. You'll have to use your developer tools in the browser to figure out what is happening.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900