Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS Nav menu font color change

Status
Not open for further replies.

SjrH

IS-IT--Management
Jun 24, 2003
747
GB
I have a simple CSS navigation menu that has been fine up until now! Here is the CSS -

Code:
div#navbar2 {
	height: 40px;
	width: 750px;
	background-color: #808080;
	float:left;
}

div#navbar2 ul {
	margin: 0px;
	padding: 0px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	color: #FFF;
	line-height: 50px;
	white-space: nowrap;
}

div#navbar2 li {
	list-style-type: none;
	display: inline;
}

div#navbar2 li a {
	text-decoration: none;
	color: #FFF;
}

div#navbar2 li a:link {
	color: #FFF;
}

div#navbar2 li a:visited {
	color: #FFF;
}

div#navbar2 li a:hover {
	font-weight: bold;
	color: #878AF5;
}

However, I now need to add a couple of items on the end of the inline menu that must be displayed in a different initial colour than the default white font.
Does an external stylesheet override embedded styles? I've tried adding the style directly to the LI A tag but I still get the default white font.

TIA
 
Does an external stylesheet override embedded styles?
From the W3C's CSS introduction:
W3C said:
Cascading Order

What style will be used when there is more than one style specified for an HTML element?

Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:

1. Browser default
2. External style sheet
3. Internal style sheet (inside the <head> tag)
4. Inline style (inside an HTML element)

So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style declared inside the <head> tag, in an external style sheet, or in a browser (a default value).

Have you checked that your pages are valid?
HTML Validator
CSS Validator

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
S'ok, just me being fick!

Sooo tired I didnt check what I was typing, simple typo error in the end!

Cheers anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top