homepage Welcome to WebmasterWorld Guest from 50.19.33.5
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: DrDoc

CSS Forum

    
the Holly Hack is Dead
sorry.. I loved it I really did
SuzyUK




msg:3636321
 8:47 pm on Apr 27, 2008 (gmt 0)

so it appeared this week in my email, the question was

Quote paraphrased
what is the up to date position on the Holly Hack? the last reference 'I' found was 2006, what is the 2008 position on this?

anyone care to give their views or are we still bowing down?

you can take from the title my personal view but I am open to opinion

 

Setek




msg:3636396
 1:20 am on Apr 28, 2008 (gmt 0)

It seems unnecessary with conditional comments being a more accurately targeting, eloquent "hack" :)

swa66




msg:3636430
 3:47 am on Apr 28, 2008 (gmt 0)

I'm in favor of killing of all hacks

- for IE: use the conditional comments ...
- the rest of the world: have the browsers adapt to the standard.
Actually I strongly feel MSFT should do that too. But in the short term their inability to get their customers on the current version and their unwillingness to fix slightly older version's bugs means we have to have the dual kludge for both IE6 and IE7, two of the more popular browsers unfortunately.

There's no way to keep up with all possible devices that will have a browser in them in the future, hence there's no way for us to test it all in the long run. [Have all PDAs? all cars? all fridges? all game consoles, all ?].
It *has* to be up to the makers of browsers to make sure they comply with standards.
It *has* to be up to us to make sure we expect rendering by browsers compliant to standards.

Hacks are used by browser makers like MSFT as an excuse not to change their ways, so we need to get rid of them in order to even have a long term future that 's survivable. (IE8, *if* it's truly standards compliant and nothing more (the latter I strongly doubt), wil take many years to get accepted by the MSFT customers (judging from the lack of acceptance of IE7).
On that note: let's not target IE8 in our conditional comments, let's make sure IE8 get's not to see anything special, so it'll have to be standards compliant if and when it comes out.

4css




msg:3636614
 10:52 am on Apr 28, 2008 (gmt 0)

It *has* to be up to the makers of browsers to make sure they comply with standards.
It *has* to be up to us to make sure we expect rendering by browsers compliant to standards

Excellent statements.

though, how do you get the browser manufacturers to comply with standards?

IMO, I think that conditional statements were always the way to go. I tried to learn the hacks, and even used them with Suzy's help on occasion on things. I just had a bit of difficulty understanding them.

Just a note though, I thought that I had read somewhere that the holly hack could be used in IE7? I'm sure it is possible I mis-read or am thinking of something else.

SuzyUK




msg:3637890
 6:40 pm on Apr 29, 2008 (gmt 0)

setek.. I agree all hacks in [lte IE 7] comments if hasLayout is truly dead then there should be no reason for IE8 to see any of the hacks used up to know whether zoom: 1; inline-block or whatever..

Debs.. the Holly hack as in it's original form is dead IMHO

The following code is an instance of the Holly hack. Primarily, the Holly hack consists of a set of hiding methods wrapped around that 1% height, which is the key to the hack. Remember, the whole idea is to let IE/Win and only IE/Win see that height and apply it to the buggy box.

/* Hides from IE5-mac \*/
* html .buggybox {height: 1%;}
/* End hide from IE5-mac */

my bold

The first line and last line are to hide it from IE/Mac, why use the parse error hack? IE/Mac does not read conditional comments so you can simply put the second line in a conditional comment.

The second line only targets IE6 and below, to make it work in IE7 it needs the star removing. So even if you remove the star because you need the hasLayout in IE7 too, and leave it in a conditional comment, it's no longer the Holly Hack, but a hasLayout trigger we now know it to be.

then Height is not safe to use. IE7 honours explicit heights which may upset/restrict designs, and even the small percentage which would likely have nothing to inherit from is not safe in all cases (IE6 or 7) [brunildo.org].

Therefore you need to change the method of triggering hasLayout - hence me declaring it dead!

Conditional Comments all the way, only using the * HTML hack inside a CC for IE6 as long as the CC is targeted at <=IE7 there's no telling when/if a browser might start flipping out at that * some time in the future!

[edited by: SuzyUK at 6:41 pm (utc) on April 29, 2008]

pixelkat




msg:3639241
 7:20 am on May 1, 2008 (gmt 0)

the holly hack has evolved into the clearfix. i'm on my pda right now and hunt-and-peck input slowing me down. google clearfix. ie still requires a conditional since it doesn't recognize :after.

SuzyUK




msg:3640355
 1:16 pm on May 2, 2008 (gmt 0)

pixelkat, that's not quite true, about the evolution that is..

the "clearfix" or the easy clearing method was around before the holly hack, or born about the same time, they are used for different purposes

the holly hack, which was simply a method of triggering hasLayout to fix IE's weird display bugs. As an aside when hasLayout is/was triggered IE would contain floats. Other browsers didn't really have a clearly defined way to clear floats so the :after (or easyclearing) method came along to complement IE's hasLayout behaviour.. IE never understood :after, so the two existed together.

Actually, nowadays there is no need for easyclearing (clearfix) either! I used for a bit in a template but only NN6 has needed it for the last year or three, so with the death of that browser I could safely say that one isn't necessary either.

IE may still need hasLayout for versions up to 7 for easy clearing of floats - (should be triggered using something other than height though) - but all browsers including IE8 now clear floats properly using either the float in a float method or the overflow property as per recs. (both overflow and float set hasLayout for IE7, so technically it's still using it's hasLayout model, although it's using the right properties per specs :o)

so lets kill all the hacks shall we ;)

[edited by: SuzyUK at 1:25 pm (utc) on May 2, 2008]

g1smd




msg:3642674
 10:20 am on May 6, 2008 (gmt 0)

I'm using a few conditional statements, but with one change... the conditional stuff is only served to you (via an 'include') if your browser appears to be True IE (version untested).

/* Get the User Agent String Supplied by the Bot or Browser. */

$user_agent_remote = $_SERVER['HTTP_USER_AGENT'];

/* Set Flag if the Bot or Browser claims to be IE, and is not Opera. */

IF (strpos($user_agent_remote,'MSIE') != FALSE && strpos($user_agent_remote,'Opera') === FALSE)
{$user_agent_is_true_ie = "1";};

/* Show these styles only to True IE user agents */

IF ($user_agent_is_true_ie == "1")
{echo ('
<!--[if lt IE 6]><link rel="stylesheet" href="/styles/ie5fix.css" type="text/css" media="all"><![endif]-->
<!--[if lt IE 7]><link rel="stylesheet" href="/styles/ie6fix.css" type="text/css" media="all"><![endif]-->
<!--[if IE 7]> <link rel="stylesheet" href="/styles/ie7fix.css" type="text/css" media="all"><![endif]-->
');};


Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved