div is a block element and span is an inline element so according to xhtml 1.0 validation it is not right but still several websites uses this method for styling is it all right ? or it will cause some problem please help me ?
but still some website uses this approach for example i saw the code of google in firebug they also used div nested in span
Mac
2010-05-27 09:31:55
So what? You still **never** need to do it and it is **always** wrong. Other authors might be willing to write bad code and risk more bugs and more undefined behaviour in exchange for … well, nothing … but that is no reason to do it.
David Dorward
2010-05-27 09:34:09
Google is famous for using 'non-validating' code. They optimize for size and speed, not valid markup.
Konerak
2010-05-27 09:39:20
+1
A:
Websites that do that wont be 'strict xhtml compliant' but in reality HTML like this will work just fine in any modern browser. That doesn't mean you should do it though - because theres no need to.
eddiegroves
2010-05-27 09:30:54