On Tue, 7 Aug 2007, Matthew Ohlman wrote: > Brian Cummiskey wrote: >> <snip> >> USE css classes or IDs, or gloabl elements. >> >> ie, instead of body bgcolor, use >> >> body { background-color: #ffffff; } in your css sheet. >> >> instead of font, use <span class="myclass"> >> and >> .myclass { color: #ffffff; } >> for example.
The original question was about markup validation, which is off-topic in this list. In this case, the error reports were technically caused by the use of a Strict doctype in a document that uses Transitional features, so they _could_ be switched off by changing the doctype declaration. But if you wish to stick to Strict and still keep the formatting, then you need to use CSS, and here we approach the topic of the list. Replacing presentational HTML attributes and elements by the use of CSS is a wide topic, and it's best studied by reading good material on CSS. On the other hand, it's often counter-productive; it's better to keep existing pages as they are and use CSS for new (or completely rewritten) pages. But if you start the replacement work, then care is needed. Both the examples given are risky: setting background-color without setting color (and background-image), or vice versa. Of course they were just examples, but they related to specific issues that were presented in the question. And since people learn from examples rather than from explanations, examples should set good examples, such as body { background: #ffffff; color: #000000; } In efforts to replace presentational HTML by the use of CSS, you might have some use for my summary of "HTML to CSS" mapping: http://www.cs.tut.fi/~jkorpela/html2css.html But I hope the information will mostly be used for mental operations rather than actual conversions. Instead of converting documents with, say, BGCOLOR attributes, into more modern approach, an author who is used to writing such attributes could use the checklist to see that the CSS counterpart is the background-color property, then read about that property and its use in some CSS tutorial or reference. > A good reference/tutorial to see this in more detail is W3Schools. You > can access the CSS tutorial at: > > http://www.w3schools.com/css/css_intro.asp I'm afraid someone needs to remind that W3Schools is regarded as unreliable source of information by many experts. And this time, that someone seems to be me... -- Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/ ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/