- This topic is empty.
-
AuthorPosts
-
May 4, 2011 at 5:06 pm #32603phette23Member
I’m a web design noob and I want to write a website using the new, semantic HTML5 elements like footer, article, section, etc. But, of course, there is Internet Explorer, which doesn’t allow styling of arbitrary elements, so I would have to use the javascript HTML5 shiv for my styles to stick. But I’m wondering: is there any disadvantage to simply nesting my non-semantic divs inside semantic markup, thus catering to both IE and modern browsers while avoiding javascript? Example:
Any reason why I should avoid this? Or do only as a supplement to the shiv? It seems like, with the right resets, it would work fine but maybe I’m overlooking something. And also: is there a logic to the nesting which makes more sense? Divs on the outside and footer on the inside?
Thanks.May 4, 2011 at 5:17 pm #47357whiteInkDesignMemberThe whole point of the new elements is so we don’t have to use divs. You’re essentially doubling the number of elements in your code by nesting divs and negating the purpose the new elements: cleaner and more semantic markup. The js shiv is a simple and clean solution for older versions of IE.
If your project is going to have a lot of viewers using old IE versions without javascript enabled, maybe its not a project best suited for HTML5. You could also put a conditional noscript tag in that tells ie users the page may not view properly with js disabled.May 5, 2011 at 8:58 am #47161phette23MemberOk, fair enough. I was thinking that, once my analytics indicated I was above a certain threshold of older IE versions, it would then be easy to strip out every div. But doubling elements and CSS isn’t worth it.
May 6, 2011 at 1:55 pm #46866TheDocMemberIn my oh so humble opinion, there really is no difference between a div with id=”footer” and the new “semantic” way of HTML5.
The best option would be to start using the new HTML5 doctype and keeping your divs for now. Over time you’ll be slowly able to transfer over.
May 6, 2011 at 4:11 pm #46814chrisburtonParticipantI think it certainly serves a great organized point and would probably help solve a lot of issues and frustration, especially here. I’m not entirely sure on the “best option” as I think that is pure opinion. To stay in the present game, I personally use the new markup.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.