Sam Brown

Giving Internet Explorer what it needs

As a follow up to my previous post, an article was posted yesterday CSS tips and tricks, Part2 I read the first Part last week which has some good basics for beginers. This Part had an area titled Giving Internet Explorer what it needs and here are the techniques best recommended:

Child Selector Hack – To hide from IE

  1. html>body p {
  2. declarations: here;
  3. }
  5. Download this code: /code/ie_childselector.txt

Star HTML Hack – To hide from all browsers but IE

  1. * html p {
  2. declarations: here;
  3. }
  5. Download this code: /code/ie_starhtmlhack.txt

Comment Backslash Hack – To hide from IE Mac

  1. /* \*/
  2. * html p {
  3. declarations: here;
  4. }
  5. /* */
  7. Download this code: /code/ie_commentbackslash.txt

IE Expressions – To send CSS to IE Only

  1. <!--[if IE]>
  2. <link rel="stylesheet" type="text/css" href="ieonly.css" />
  3. <![endif]-->
  5. Download this code: /code/ie_expression.txt

All having the uses, but for future updateability and ease of use when updating styles, it is a pain using hacks. So best avoid if you can!

Post a link to this on Twitter ↩


There currently aren't any comments on this post, leave the first?

Commenting has closed for this article. Feel free to me.

Sam Brown co-founded Iterate, and was previously VP of Design at Foursquare. Based in NYC.