PDA

View Full Version : Validating My Pullquotes


campo
August 4th, 2007, 02:28 PM
Hi to you all.

I pride myself that in over 700 pages on my websites almost everything will validate but, increasingly, I also want to validate my use of CSS. Mostly that is fine but I just discovered that my rather dramatic pullquotes system from a main article (while presenting no problem for xhtml validation), will not validate as CSS.
Here is the CSS I use (within an article when and where I need it):

<p style=
"float:left;width:35%;padding:8px;border:2px solid black;font-size:1.5em;line-height:1.2em;margin-top:15px;margin-left;20px;margin-bottom:15px;margin-right:30px;background-color:#ffffcc;font-weight:bold;">

That basic system works real fine. I would be most grateful how to tweak this for CSS validation ??

campo

oracle128
August 4th, 2007, 02:56 PM
Between margin-left and 20px should be a colon. You have a semi-colon.
margin-left;20px;

campo
August 4th, 2007, 03:25 PM
Oops - that was real stupid of me! Should have noticed!!
Will put that right and see if it validates!
Thanks, mate.

campo
August 4th, 2007, 05:13 PM
Yes, thats fine. But why is it that these CSS validating pages only (apparently) look for the style sheet?
When CSS is used in this way (among the html, rather than in the 'head'), it seems to be ignored by CSS validation things - or, so it appears to me.

Buzz
August 4th, 2007, 08:53 PM
CSS is called in a hierarchy basically. External style sheet, in page style sheet then inline styles. Quite honestly I'd set a class for that paragraph and then apply the class. The whole point of a style sheet is to allow you to quickly alter several elements at once. If you put inline styles for every element you're basically creating more work in the future, not less. The validators look for style sheets because that's how it should be done.

campo
August 5th, 2007, 08:00 AM
Thanks, Buzz. I take your point. But until about 18 months ago I used virtually no CSS at all and my approach to it is still largely experimental - I like certain attractive things it can do.
I now have over 700 website pages and will never apply one CSS format to all of them. In fact, they are quite attractive as they are and about 95% will validate either under html 4.01 or - in most cases - xhtml trans.
But - in the future - I may well apply a general CSS format to all new pages.

Buzz
August 5th, 2007, 08:11 AM
You can still use a style sheet and apply classes to pages you DO wish to style. There's no need for so much inline styles.