navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Struggling with CSS Validation

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Struggling with CSS Validation
Page: [1]
 
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
Struggling with CSS Validation - 10/1/2005 9:25:09   
Tidying up my FP web http://www.cmy.org.uk with basic CSS stylesheet. Can someone help me, or point to a site with all the CSS statements explained?
The validator rejects the background and text-align statements, but doesn't say how to fix them. Grateful for your help. The is the code for the top bar:
#logo, #logo a {
font-size: 90%;
background: #6595D6;
background-image: url(../_includes/classic.gif);
background-repeat: repeat-x;
color: white;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-style: normal;
font-variant: normal;
text-transform: none;
font-weight: bold;
padding: 4px 4px 4px 4px;
border-left-width: 0px; border-right-width: 0px; border-top-width: 1px; border-bottom-width: 0px;
border-color: white;
text-align: left;
}
/* end of code */
Thanks. :)
Tailslide

 

Posts: 5972
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 9:55:39   
Having problems getting through to your page to check.

What exactly is the validator saying about the errors?

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to scottishagate)
coreybryant

 

Posts: 2422
Joined: 3/17/2002
From: Castle Rock CO USA
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 10:30:10   
For the background, try
background-image: url('../_includes/classic.gif'); 
and for the background color:
background-color: #6595D6;
. Also, what validator are you using?

_____________________________

Corey R. Bryant
Merchant Accounts | Toll Free Numbers | My Blog | Expression Web Blog

(in reply to Tailslide)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 10:34:03   
Sorry about the link, this is the real address http://redhunter.com/cmy/
The Validator messages -

background-image
#Warning: The shorthand background property is more widely supported than background-image.
background-repeat: repeat-x
#Warning: The shorthand background property is more widely supported than background-repeat.

If I change both to "background" I get other error messages.


(in reply to Tailslide)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 11:09:08   
Hi, Corey
I'm using the Validator at http://www.htmlhelp.com/tools/csscheck/
I have changed as you suggested. Now I get different error messages, thus

# Warning: The shorthand background property is more widely supported than background-color.
# background-image: url('../_includes/classic.gif')
Warning: The shorthand background property is more widely supported than background-image.
# background-repeat: repeat-x
Warning: The shorthand background property is more widely supported than background-repeat.

Seem to be going round in circles!

(in reply to coreybryant)
spitfire

 

Posts: 424
Joined: 8/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 11:16:52   
The validator is giving you a warning, not an error message. It suggests that the shorthand form for all the background properties is better supported by (modern) browsers.
In your case you would use this code, which validates:
#logo, #logo a {
background: #6595d6 url(../_includes/classic.gif) repeat-x;
color: white; }

instead of
background: #6595D6; 
background-image: url(../_includes/classic.gif); 
background-repeat: repeat-x; 
color: white; 

Opinions are mixed about whether you should include image URLs within single quotes or double quotes or no quotes at all - they all validate. Personally, I've had no problems using any of them, but it is best to be consistent through the site.

I could not get to the css validator (W3C) through the live site because of some validation problems with the html document itself: http://validator.w3.org/check?verbose=1&uri=http%3A//redhunter.com/cmy/ . Best to have a look at those (only 5) and fix them up as soon as you can.

(in reply to scottishagate)
coreybryant

 

Posts: 2422
Joined: 3/17/2002
From: Castle Rock CO USA
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 11:35:12   
And one thing to keep in mind, if you specify the font color, you should specify the background-color

_____________________________

Corey R. Bryant
Merchant Accounts | Toll Free Numbers | My Blog | Expression Web Blog

(in reply to spitfire)
spitfire

 

Posts: 424
Joined: 8/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 11:46:00   
Or rather, a color for the background as in the first piece of code above. It doesn't necessarily have to be background-color: #6595d6.

Failure to provide either a color for the foreground/font or a color for the background will just give you a warning. On the W3C (jigsaw) css validator, many web sites are currently receiving loads of color pairing warnings. This check has been introduced relatively recently, or rather I should say, it has been re-introduced after about 2 years absence and has caught people out:)

(in reply to coreybryant)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 12:33:28   
Thanks, everyone. I will fix the errors in the homepage HTML. Some of them are FP code, e.g. if you want a line break, FP inserts <br> but it should be <br />, really annoying.
Hopefully it keeps my old brain active :)
Will get back to this tomorrow. Thanks meantime.

(in reply to spitfire)
spitfire

 

Posts: 424
Joined: 8/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 12:58:09   
That'll be FP5 for you, giving you HTML4.xx code - whereas you have moved on to xhtml - congrats.
Regards
Spitfire
ps try <style type="text/css"></style> Couldn't resist taking a look.
pps now... about the problems I'm having with my family history :)


< Message edited by spitfire -- 10/1/2005 13:40:56 >

(in reply to scottishagate)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 13:40:44   
quote:

ORIGINAL: spitfire
That'll be FP5 for you, giving you HTML4.xx code - whereas you have moved on to xhtml - congrats.

Crivvens maybe that's A Bridge Too Far, I don't even know the difference, or where I got that DocType header ....
quote:

try <style type=text/css></style>

Done that, thanks.
quote:

now... about the problems I'm having with my family history

If it's Scottish - mail me. :)

(in reply to spitfire)
spitfire

 

Posts: 424
Joined: 8/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 13:46:19   
Ooooops - quick edit above - caught out. Check out the quotes around text/css.
English, I'm afraid - Cornwall and Devon mainly - a real pain getting back beyond around 1800. Ah well back to the parish records:).

(in reply to scottishagate)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 19:13:45   
quote:

ORIGINAL: spitfire
Ooooops - quick edit above - caught out. Check out the quotes around text/css.
Ooops to you too! I already had the quotes, and just left them in, seems OK? Triumph, my page validates
http://validator.w3.org/check?uri=http%3A%2F%2Fredhunter.com%2Fcmy%2F
how do you get from there to the CSS validation?
Regret my stylesheet is in a hidden folder.

(in reply to spitfire)
spitfire

 

Posts: 424
Joined: 8/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/1/2005 19:40:52   
Here you go:
http://jigsaw.w3.org/css-validator/

That's two of us up far too late for our own good :)

(in reply to scottishagate)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/2/2005 6:21:26   
Hi, Spitfire
Sunday morning - up and running ... well ... not quite ...
Thanks for link to W3C jigsaw validator, I hadn't realised I could validate the HTML and CSS in one go.
It's more forgiving than WDG validator, my CSS validates without all the warnings about background-color, text-align, etc. http://tinyurl.com/8hyg4
I realise it's still a mess and full of redundancies. Will keep picking at it.
I wish I could test CSS changes without continually updating, and perhaps breaking, my live site. Is there anything (free or cheap) that I could use locally? I have CSE HTML Validator Lite for html.

(in reply to spitfire)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/2/2005 6:27:38   
quote:

ORIGINAL: spitfire
In your case you would use this code, which validates:
#logo, #logo a {
background: #6595d6 url(../_includes/classic.gif) repeat-x;
color: white; }


I forgot to say. I tried this, but must have misunderstood something. My logo/topbar shrank in height, and the footer bar completely lost the image. Hastily restored my messy code till I suss it out :)

(in reply to spitfire)
spitfire

 

Posts: 424
Joined: 8/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/2/2005 7:05:43   
Should have been more explicit - sorry:)
That piece of code condenses just the three "background" declarations into a single (shorthand) line. You'll still need all the other bits and pieces that go with the #divs.
Easy and free validation:
Get this web developer toolbar for IE: http://www.nils.org.au/ais/web/resources/toolbar/
and this one for Firefox: http://chrispederick.com/work/webdeveloper

It's always best to preview your site in at least two browsers, because there can be rendering differences.
Both toolbars allow you to validate your html and css code locally or to validate on-line. But there are oodles more features to delight - have a great Sunday afternoon, playing err... experimenting with them:)

(in reply to scottishagate)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/2/2005 8:00:09   
quote:

ORIGINAL: spitfire
Should have been more explicit - sorry:)
That piece of code condenses just the three "background" declarations into a single (shorthand) line. You'll still need all the other bits and pieces that go with the #divs.

Yes, I can see the logic. I just replaced the longer declarations. But must have missed a semicolon or curly bracket somewhere, and it fell over! Will try again, now I have those toolbars - the Firefox one is amazing.
I am making a copy of my web to play with. Grateful for your expertise. :)


(in reply to spitfire)
spitfire

 

Posts: 424
Joined: 8/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/2/2005 8:23:57   
You're welcome.
That'll be a few more late nights/early mornings for you then:)

(in reply to scottishagate)
d a v e

 

Posts: 4054
Joined: 7/24/2002
From: England (but live in Finland now)
Status: online

 
RE: Struggling with CSS Validation - 10/2/2005 9:20:50   
try topstyle lite - free css editor might make things a bit easier for you
http://www.bradsoft.com/download/index.asp

_____________________________

David Prescott
Gekko web design

(in reply to spitfire)
scottishagate

 

Posts: 15
Joined: 2/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/2/2005 15:17:31   
Thanks so much, that looks very useful. :)

(in reply to d a v e)
jaybee

 

Posts: 14122
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: Struggling with CSS Validation - 10/3/2005 19:07:18   
quote:

This check has been introduced relatively recently, or rather I should say, it has been re-introduced after about 2 years absence and has caught people out:)


Ha ha ha yes, thanks Spit, we'd noticed. :)

What I don't get with that is I've specified a background colour in body or in the div but then when I use a nested div with a font colour I get a complaint. Mind you, I've not had time to look at it very closely to see exactly what the complaint is about and whether it makes sense.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to scottishagate)
spitfire

 

Posts: 424
Joined: 8/6/2005
Status: offline

 
RE: Struggling with CSS Validation - 10/4/2005 6:05:46   
Hi Jaybee
I think it's all down to inherited values and trying to (en)force them using !important. [ http://www.w3.org/TR/CSS21/cascade.html section 6.2.1 ]
The WDG (htmlhelp) validator has always checked for colour-pairing. W3C could well have dropped it because !important became something of a "crutch made of straw" - it will crumble under user stylesheets and some accessibility options. Now, it's re-introduction seems to have been rationalized on accessibility grounds and a warning (or advisory, if you will) is issued for those developers who want to make their pages (relatively) accessible.

W3C also seem to have ventured further into outer-space and issue warnings for matching background and border colours. A real pain for those using menu lists and such like - hey ho:)

(in reply to jaybee)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Struggling with CSS Validation
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts