HTML5 Shiv

html5shiv

In anything IE, excluding the most recent version (IE9), you cannot apply styles to elements that the browser does not recognize. Your spiffy, new HTML5 elements, in all their glory, are impervious to CSS rules in that environment. This is where Remy Sharp’s html5shiv (sometimes called html5 shim) comes to the rescue. Simply include it in your page’s <head> section and you will be able to style the new HTML5 elements perfectly.

<!--[if lt IE 9]>

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Notice how the conditional comments only load the html5shiv code on the condition that the version of Internet Explorer is lower than 9. Other browsers, such as Firefox and Chrome, will also ignore this tag and won’t execute the script, thus saving bandwidth.

html5 shiv is based on a simple workaround: it directs IE to create the elements with JavaScript (they don’t even need to be inserted into the DOM).

document.createElement('header');

At this point, they can be styled normally. Additionally, the more recent versions integrate IE Print Protector, which fixes a bug where the HTML5 elements disappear when printing the page.

Souce – net.tutsplus.com

Advertisements

Posted on March 26, 2013, in Web and tagged , , , , . Bookmark the permalink. 12 Comments.

  1. What’s up Dear, are you really visiting this website on a regular basis, if so after that you will without doubt obtain nice experience.

  2. Hi you have a nice weblog. I wanna thank you for posting this interesting information with us. Keep up great job.

  3. I am extremely inspired along with your writing skills as well as with the format in your weblog. Is that this a paid topic or did you customize it your self? Anyway keep up the nice high quality writing, it’s uncommon to peer a great weblog like this one these days..

  4. Hey there, I think your site might be having browser compatibility issues.
    When I look at your website in Chrome, it looks fine but when opening in
    Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other then that, superb blog!

  5. Excellent web site you have here.. It’s difficult to find quality writing like yours nowadays. I seriously appreciate individuals like you! Take care!!

  6. Thanks for finally writing about >HTML5 Shiv
    | Super-Oxide Blog <Liked it!

  7. I quite like reading a post that will make men and
    women think. Also, thank you for allowing for me to comment!

  8. An impressive share! I have just forwarded this onto a
    friend who was doing a little research on this.
    And he actually ordered me dinner because I found
    it for him… lol. So let me reword this…. Thank YOU for the meal!
    ! But yeah, thanks for spending the time to talk about this subject here on your web
    site.

  9. I needed to thank you for this excellent read!

    ! I absolutely enjoyed every little bit of it.
    I have you bookmarked to check out new things you post…

  10. Hey There. I discovered your weblog the use of msn.
    This is a really well written article. I’ll make sure to bookmark it and return to learn more of your useful info. Thank you for the post. I’ll certainly comeback.

  11. My brother suggested I might like this website. He was entirely right.

    This post actually made my day. You cann’t imagine simply how much time I had spent for this information! Thanks!

  12. Quality articles or reviews is the secret to invite the users to pay
    a quick visit the website, that’s what this website is providing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: