Cookie

TheJoe.it Into the (open) source

15Jun/100

CSS: code dedicated to IE7 and IE8

css-code

After a long hiding in the field of articles devoted to the network, here we are talking about CSS and web. In today's article we look at some interesting hacks to join our CSS to fix bugs (and there are many) of Internet Explorer, version 7 and the following.

An important premise to do is without a doubt count IE6 from the browser no longer supported because obsolete. By the way if anyone cares to point out the site "ie6nomore", initiative which has as its purpose to make coscenti users who use IE6 that it is a old and flawed browser, and therefore should be replaced. The site provides a few lines of code HTML to include in your site that allow the user to directly download a browser undoubtedly better.

A first step was to declare the version 6 Internet Explorer obsolete and unsuited to navigation, others will follow, but in the meantime let's see how to give a view the site correctly the Microsoft browser that still resist the declaration of obsolescence: IE7 and IE8.

We can use these 3 variants directly attribute to target the css code on IE7 and 8 (and lower) depending on the need.

IE7 and lower

body {  color: #FFF;
 *color : #DDD; /* IE7 e inferiori*/
}

IE8 and lower

body {
color: #FFF;
color : #CCC\9; /* IE8 e inferiori */
}

A different technique, but with the same result is that of "conditional comment" with which you can assign code CSS depending on the IE version. This method, must be called in a page HTML and not in the CSS.

This is.

<!--[if IE 6]>
Istruzioni per IE 6
<![endif]-->

Obviously the use of these hacks should not be necessary. So let's use them only in case of extreme need.

About

I keep this blog as a hobby by 2009. I am passionate about graphic, technology, software Open Source. Among my articles will be easy to find music, and some personal thoughts, but I prefer the direct line of the blog mainly to technology. For more information contact me.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.