Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

In case I will use any of the new HTML5 Tags like:

<article> or <section> ...

with a doctype of

<!DOCTYPE html>

1.) Can I directly assign a style to this element like:

<article style="margin:100px;"> ?

http://dev.w3.org/html5/spec/Overview.html#the-article-element

The W3C link does not explain this really well for HTML5 very dummy friendly.

2.) In case this is allowed, what is a browser expected to render, if the browser does not support the tag (=does not support html5) . Will it render it as div (and apply the CSS) or will the tag be completly omitted and therefore also the applied CSS formatting is lost?

Thanks very much! Jens

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Yes, you can assign a style to this element (but it's best to use external CSS instead of inline styles).

Now if the browser doesn't support the tag it'll render by default with 'display:inline', or even doesn't render, we don't know for sure what'll happen.

To make sure you can use all the HTML5 tags you may use JavaScript. Here's a link to a Google Code Project called HTML5Shim that assure you can use HTML5 in all browsers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.