Skip to content Skip to sidebar Skip to footer

Can I Use Css3 With Xhtml 1.0?

Can I use CSS3 properties with XHTML, or only with HTML5 web pages? Is there any relation between HTML version and CSS, or is it totally indifferent? Thanks.

Solution 1:

If the browser support CSS3 and XHTML 1.0, you can use both.

The two standards are not tightly linked to each other, that is what version of CSS you use has no relation to what version of (X)HTML you use.

This is one of the benefits of the separation of content (XHTML) from display (CSS).

Solution 2:

I think you can, I just check this fragment of code:

<divstyle="text-shadow: 2px 2px 2px #000;">Something</div>

The style is definitely a CSS3 only. And according the http://w3c.org/validator, this bit of code is valid. If you have any doubt, just use that to check

Solution 3:

You can just add the properties (or selectors) and the browsers that undersands it would render it no matter what DOCTYPE you use. The CSS might not validate though. Thank you progressive enhancement and graceful degradation!

Post a Comment for "Can I Use Css3 With Xhtml 1.0?"