Peter,

re: <a> elements may only contain other inline elements

hang on,
so if i have an anchor tag wrapped around an image (display:inline by
default), its deemed fine by the validator, but if I make that image
"display:block" via the css, (for design purposes, which must be a
pretty common practice on many, many sites - including many i've
designed) would that practice be frowned upon if the validator could
validate your markup *and* the corresponding css at the same time?

No, the two models are similar but different.

In HTML, an element's display type does not change even if you use the display property of CSS - that's simply how the element is rendered. In terms of the document tree, and as far as a validator is concerned its still a block or inline element as defined by the DTD.

possibly some bigger questions there - one being, why shouldnt you be
able to wrap a anchor around a block level element?

Cause you can't :-)
This is a legacy of SGML. For whatever reason, way back when, certain containment constraints on elements were decided upon, and they stay with us still.

Similarly, <p> elements can't contain other <p> elements. (though I reckon that's a legacy of tag soup days when people did this <p>a paragraph <p> a new paragraph so much that paragraphs implicitly closed themselves when they met a new opening <p> element )

i know the
difference between inline and block, and the fact that block elements
cant be inside inline elements - but this particular anchor question
seems a bit shakey....

Yes, though in practical terms I've never found it an issue ('til I started playing round with Microformats, particularly hCard). That's why I really really wanted to be sure. But that's for a whole nutha post

j

p.s. any rugby fan WSG members whole live near Bondi, I'll be at the beach road hotel to watch the Super 12 final (I only say this cause Peter lives in Bondi too, though he probably quite sensibly hates rugby :-)

john

John Allsopp

style master :: css editor :: http://www.westciv.com/style_master
support forum ::  http://support.westciv.com
blog :: dog or higher :: http://westciv.typepad.com/dog_or_higher

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to