Forum Moderators: not2easy

Message Too Old, No Replies

Trouble with some code

I'm having trouble styling some links...

         

thetechgeek

7:06 pm on Oct 27, 2007 (gmt 0)

10+ Year Member



Hello everybody,
I'm having some trouble styling some links on my pages. Here's an example of my code for a link:
a:link {
color: f3f3f3;
text-decoration: none;
}

This makes the link un-underlined, but for some reason, the link still shows up blue.

Here's some snippets-
The HTML-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>The Title</title>
<link type="text/css" rel="stylesheet" href="./style.css" />
</head>
<body>
<div id="container">
<div id="header">
<h1 id="title">The title</h1>
<h3 id="subtitle">The subtitle............</h3>
</div>
<div id="sidebar">
<ul>
<li id="menu"><a href="./index.html">Home</a></li>
<li id="menu">Product 1
<li id="submenu"><a href="">Overview</a></li>
<li id="submenu"><a href="">Screenshots</a></li>
<li id="submenu"><a href="">Download</a></li>
</li>
<li id="menu">Product 2
<li id="submenu">Overview</li>
<li id="submenu">Download</li>
</li>
</ul>
</div>
</div>
</body>
</html>

The CSS-

body {
margin: 0px;
padding: 50px;
text-align: center;
font-family: Trebuchet MS, sans-serif;
font-size: 13pt;
color: #f3f3f3;
background:#222;
}
#container{
text-align: center;
}
#header {
border: 10px solid #fff;
}
#title {

}
#subtitle {

}
#sidebar {
text-align: left;
padding: 0px;
margin: 0px;
float: left;
border-left: 10px solid #fff;
border-right: 10px solid #fff;
border-bottom: 10px solid #fff;
}
ul {
padding: 0px;
margin: 0px;
list-style: none;
}
#menu {
padding-left: 30px;
padding-right: 30px;
margin: 0px;
background-color: #434343;
}
#submenu {
padding-left: 60px;
padding-right: 30px;
margin: 0px;
background-color: #434343;
}
a:link {
color: f3f3f3;
text-decoration: none;
}
a:visited {
color: efefef;
text-decoration: none;
}
a:hover {
color: f9f9f9;
text-decoration: none;
}

penders

7:51 pm on Oct 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



a:link {
color: f3f3f3;
text-decoration: none;
}

This might work in IE, but you are missing the '#' before the rgb colour value (which you include in other parts of your CSS, but not your anchors)...

color: #f3f3f3;

rocknbil

10:02 pm on Oct 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard thetechgeek, I will add - the reason the pound sign is needed is because you are using a valid document type, which causes the page to render in Standards Compliance Mode. In Standards mode f3f3f3 is not a valid color. Removing the doctype would "fix" it by rendering in Quirks mode - but you don't want to do that.

thetechgeek

7:35 pm on Oct 28, 2007 (gmt 0)

10+ Year Member



...Hehehe.
Phew, this what happens after you haven't done any CSS for half of a year.