views:

519

answers:

2

Hi, I'm using the HTML5 elements and in a project i'm working on (see it here) and the css seems to be working fine in Chrome. However, it doesn't appear to be working in Safari or Firefox (I haven't tested IE, but I'd imagine it's the same), and the page layout is all over the place.

Any ideas why this may be? I know Firefox and Safari both support these elements, and Safari is webkit-based like Chrome, so I can't figure out what the problem is.

You can see the webpage here.

+3  A: 

Safari and Firefox have the same level of ‘support’ for HTML5 sectioning elements (after seeing your demo page, I’m guessing these are the elements you’re talking about): they can be styled, but you have to set display: block; implicitly.

aside, article, section { display: block; }

Adding this rule to your CSS will solve the problem.

To make these elements stylable in IE, you just need to use the HTML5 shim/shiv. Put the following HTML in your <head>:

<!--[if lte IE 8]>
 <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
<![endif]-->
Mathias Bynens
Ah yeah, that's it! I forgot the CSS needed to be kicked into action with 'display:block'. I am actually using the Shiv if you take a look at line 20. Thanks!
Chris Armstrong
A: 

Which part isn't working exactly? The <canvas> element appears to be rendering correctly, your <article> container isn't being ignored.

I'm in FF3.6.2, btw. The only CSS errors I see are just that: CSS errors.

dclowd9901