Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;"> ?


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
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


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.