Sign in to follow this  
Seriema

[web] CSS,validation problem

Recommended Posts

(updated) Hi! I'm currently updating my CSS to conform to CSS 2.0, not much to do - was only one error. I've got 1 weird warnings (level 1). About the background-color attribute for the a-tag. Doesn't a:link inherit values from a? It does so for the other values. Here's the validation result (The CSS source is visible in the end.) [Edited by - Seriema on November 9, 2005 10:41:06 PM]

Share this post


Link to post
Share on other sites
for A, you have a background-color of transparent. Maybe it doesn't recognize it as a color and so it bombs.

for A:Hover, you lack a background-color

for the other one you lack a color.

Share this post


Link to post
Share on other sites
Thank you cap. The 3rd warning was just me being blind. The 1st, apperently transparent doesn't count but inherit does. The 2nd is the last... a:hover doesn't inherit a because it's a required attribute?

Share this post


Link to post
Share on other sites
I fixed the last warning by just putting a value... But now I have a warning I really don't understand:
Line : 51 (Level : 1) You have no color with your background-color : #main

Line 51: background-color: #FFFFFF;
I've tried with rgb(255,255,255) and white, same warning.

complete CSS:

body {
font-family: Arial,Helvetica,sans-serif;
color: rgb(0, 0, 0);
background-color: #7B88A6;
}


h1 {
font-weight: bolder;
text-decoration: none;
font-family: Arial,Helvetica,sans-serif;
font-size: x-large;
}

h2 {
font-size: medium;
font-weight: bold;
font-family: Arial,Helvetica,sans-serif;
}

h3 {
font-size: small;
font-style: normal;
font-family: Arial,Helvetica,sans-serif;
}

a {
font-family: Arial,Helvetica,sans-serif;
font-weight: bold;
text-decoration: none;
color: rgb(89, 89, 89);
background-color: inherit;
}
a:hover {
text-decoration: underline;
color: rgb(166, 166, 166);
background-color: inherit;
}

table {
background-color: rgb(255, 255, 255);
color: inherit;
}


#main {
width: 738px;
padding: 10px;
margin:0px auto;

background-color: #FFFFFF;

border-width: 0 2px 2px 2px;
border-style: outset;
}

#navigation {
width: 738px;
margin:0px auto;

padding: 0;
border-width: 0;
}
#navlist {
font-size: 10pt;
text-transform: lowercase;
font-weight: bold;
text-align: center;

padding: 0;
margin: 0;
}
#navlist li {
display: inline;
list-style-type: none;
}
#navlist li a {
border-left: 2px solid rgb(89, 89, 89);
border-right: 2px solid rgb(89, 89, 89);
padding-left: 0.5em;
padding-right: 0.5em;
}

#validation {
text-align: center;
}

#affiliates {
text-align: right;
}


Share this post


Link to post
Share on other sites
I guess I just suck at understanding the error/warning messages... apperently it meant that I must have a color attribute if I specify a background-color attribute...

Share this post


Link to post
Share on other sites
I had that question on another forum today and by searching on google for the warning message, I found a discussion that tried to explain it. Basically, it is a warning that means that on some broken browsers (Netscape 4), using a transparent background or some other combinations of non-explicit color and background-color values could make the text unreadable. So it's more or less FYI, and if you're sure that it won't cause problems you can just ignore the warning.

(edit) Linky

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this