Jump to content
Killersites Community
Sign in to follow this  
Samitou

HTML 5 not working in IE 7

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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Try writing the conditional comment like this and see if it makes a difference

 

<!- -[if IE]>

 

<link rel=”stylesheet” type=”text/css” href=”whatever you named your style sheet”/>

 

<![endif]- ->

Edited by grabenair

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×