Jump to content

HTML 5 not working in IE 7


Samitou

Recommended Posts

Hello,

 

i have just bought a one year membership to the Killersite university. I have downloaded the project file for the HTML5 CSS3 project and put the folder on my desktop. When i view the index page in Firefox, everything is fine, but in IE 7, everything is all over the place. I know that in the videos the teacher talks about the code "lt IE9". Normally it should work with any browser. Is it only because the root folder is on my desktop and not online that IE7 do not display the site correctly?

 

Regards.

Link to comment
Share on other sites

You will be experiencing problems with this a lot with IE, well not so much sense IE9. We have to write what is called conditional comments to deal with this problem. Conditional comments in short are css rules that we write in a separate css file and link them to the page to deal with IE. You do not generally have to rewrite the hole style sheet just the css like changing the margin for example to make things line up in IE. If you look through the archives here you will find a lot on this.

If You are just starting out I would suggest that you get familiar with html and css and then work on the conditional comments as you progress. This is just my personal opinion.

Edited by grabenair
Link to comment
Share on other sites

Note that you have lt IE9 when there should be a space between IE and 9:-

<!--[if lt ie 9]> your different styles here  <![endif]-->

 

The above code should go in the head section AFTER the main stylesheet link or after the head section style tags so that it supersedes them. Styles written inline (inside html tags) will take priority over those in a conditional comment.

 

It should work from a local file or online.

 

the teacher talks about the code "lt IE9". Normally it should work with any browser.

The lt IE 9 conditional comment should work with all IE browsers less than IE 9 (assuming that your styles inside the conditional comment are appropriate and supported by the IE version).

Edited by Wickham
Link to comment
Share on other sites

  • 2 months later...

HTML5 must require some capability into web browsers. IE 7 can not support coding system of HTML 5 so, it’s better to use any latest version of Internet Explorer as IE 8 or any advanced. You have said that your website working in Firefox browser at its best then there is no needs to make in changes in CSS or coding.

Edited by brainusa
Link to comment
Share on other sites

  • 3 months later...

You would also want to add the following to the CSS file

right at/near the top:

 

 

/*html5 display rule */

address, article, aside, canvas, content, details,

figcaption, figure, footer, header, hgroup, nav,

menu, section, summary {

display: block;

}

 

 

As mentioned in a previous post, Google html5 shiv (or shim)

and copy/paste the code in the head section.

The current (Oct. 2012) code is this:

 

<!--[if lt IE 9]>

<script src="dist/html5shiv.js"></script>

<![endif]-->

 

 

I learned the above from Ben Falk in a PHP class.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...