Get support from Xavier Media
It is currently Sun Dec 08, 2013 12:23 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: The Underscore Hack
PostPosted: Tue Oct 10, 2006 3:33 pm 

Points:
Quote:
Let's start with three simple facts ? as Petr Pisar found out.

1. The underscore ("_") is allowed in CSS identifiers by the CSS2.1 Specification
2. Browsers have to ignore unknown CSS properties
3. MSIE 5+ for Windows ignores the "_" at the beginning of any CSS property name

Therefore, a CSS definition, e. g. _color:red is:

1. Correct, for CSS 2.1 specification allows it (even if software validators, knowing only older version CSS 2.0, say it's a bug: they are wrong, it's correct).
2. Ignored in any browser but WinIE
3. Treated as color:red in WinIE

Thus, this IE's bug/feature is very simple and clear way to set CSS properties for WinIE only (MacIE doesn't have this bug/feature).

It's easy to fix e. g. mis-implemented "position:fixed" in WinIE:
Code:
#menu {
   position: fixed;
   _position: absolute;
   ...
   }


Same method may be used to fix the min-height property missing in WinIE:
Code:
#box {
   min-height: 300px;
   height: auto;
   _height: 300px;
   ...
   }



http://www.wellstyled.com/css-underscore-hack.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 11, 2006 3:13 pm 

Points:
Yeah this is pretty usefull.


Report this post
Top
  
Reply with quote  
 Post subject: CSS Star
PostPosted: Tue Oct 17, 2006 8:38 pm 

Points:
I found another way to trick IE into doing what it should do anyway...

Stars in CSS


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]