Menu

#17 IE Hack

open
nobody
None
5
2008-11-05
2008-11-05
Anonymous
No

Hello,

The function "is_token" considers '/' or '*' as tokens.
So these characters are stripped in css properties.

In this example

.fakeList a {
width: 100%;
display: block;
height: 30px;
padding-top: 2px;
- padding-top: 0;
line-height:18px;
* line-height:17;
/ line-height:none;
_ background-image: url(/ttt/gf.gif);
}

csstidy give

-----------------------------------

.fakeList a {
width:100%;
display:block;
height:30px;
padding-top:2px;
-padding-top:0;
line-height:none;
_background-image:url(/ttt/gf.gif);
}
-----------------------------------

6: Invalid property in CSS2.1: -padding-top
10: Invalid property in CSS2.1: _background-image

-----------------------------------

In fact csstidy (with --discard_invalid_properties=false) should give

-----------------------------------

.fakeList a {
width:100%;
display:block;
height:30px;
padding-top:2px;
-padding-top:0;
line-height:18px;
*line-height:17;
/line-height:none;
_background-image:url(/ttt/gf.gif);
}
-----------------------------------

6: Invalid property in CSS2.1: -padding-top
8: Invalid property in CSS2.1: *line-height
9: Invalid property in CSS2.1: /line-height
10: Invalid property in CSS2.1: _background-image

-----------------------------------

and that (with --discard_invalid_properties=true)

-----------------------------------

.fakeList a {
width:100%;
display:block;
height:30px;
padding-top:2px;
line-height:18px;
}
-----------------------------------

So I have corrected the problem :)

This is very usefull for IE 6 & 7 Hacks that use these "tockens" http://www.javascriptkit.com/dhtmltutors/csshacks3.shtml

Christophe Colombier
A french developer

Discussion

  • Nobody/Anonymous

    IE Hack Update

     
  • Nobody/Anonymous

    Please note that "discard_invalid_properties=true" will remove those Hacks

    -----------------------------------

    .fakeList a {
    width:100%;
    display:block;
    height:30px;
    padding-top:2px;
    line-height:18px;
    }
    -----------------------------------

    6: Removed invalid property: -padding-top
    8: Removed invalid property: *line-height
    9: Removed invalid property: /line-height
    10: Removed invalid property: _background-image

    -----------------------------------

    Christophe Colombier

     

Log in to post a comment.