Re: HTML 5 Conformance Checker

2014-01-23 12:58, David Dorward wrote:

> [The site] also uses obsolete presentational markup.

More exactly, it uses markup that is declared as obsolete (and 
non-conforming) in HTML5 drafts. This is why the experimental HTML5 
checker reports such markup.

> A good CMS will provide means for authors to achieve the effects they
> want using modern approaches rather then those from the 1990s.

Maybe. Switching to a good CMS might not be a realistic option.

>> Are table alignment, image border, cell padding, cell spacing
>> declarations
>> obsolete?
>
> In HTML they are.

According to the W3C HTML5 drafts, which are work in progress and carry 
boilerplate statements saying that it is inappropriate to cite them 
except as work in progress, they are. According to the W3C 
recommendations HTML 4.01 and XHTML 1.0, they are not (but they are 
marked as deprecated - they are still conforming).

> CSS has replacements for all of them (and has done for
> over 15 years).

And now most browsers support most of those replacements. But replacing 
presentational markup by corresponding CSS rules gives no tangible 
benefits but involves the risk of something going wrong a) because a 
mistake is made in the process (misunderstanding, typo...) or b) due to 
lack of support in all browsers still in use - e.g., the CSS replacement 
for cellspacing lacks support in browsers that are still relevant.

It is generally futile to fix existing HTML code that works. Writing new 
pages is a different thing, but even there, there are cases where 
presentational HTML markup is the practical man's choice.

>> Must all <td> elements be the same width?
>
> No. CSS has many selectors and combinators other than the type selector,
> so you can apply different widths to different cells with CSS.

Besides, a width attribute in a <td> element can always be replaced by a 
class or id attribute and a simple CSS rule that uses a class or id 
selector. But again, it's pointless to rewrite working code without a 
real reason. A real reason would be e.g. the desire to switch to using a 
unit that is relative to font size - you cannot do that in HTML, only in 
CSS.

When you wish to check legacy pages that have loads of presentational 
markup, it's a good idea to use the checker version
http://validator.w3.org/nu/
which has nice options - you can easily switch off messages that you are 
not interested in, like messages about presentational markup used on 
purpose. This way you can have your pages checked to detect some *real* 
problems in markup.

Yucca

Received on Thursday, 23 January 2014 12:10:55 UTC