Old CSS - what does/did this do?

I have just been looking at a website I created ages ago and have come across the following CSS:

head+body #content:after {
	content: "";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
}

Does anyone know what this is supposed to do? I seem to recall it was a common technique for handling old IE versions, but what it did I have no idea. Is it perhaps a clearfix method?

Looks like some form of clearfix to me, an odd selector though.

1 Like

Yes its the old clearfix technique.

I guess the head+body was to exclude old IE6 but wasn’t necessary.

3 Likes

I did wonder about that, as in when would the body not be the adjacent sibling to head?
A. When “adjacent sibling” doesn’t work.

1 Like

Yes, there were some oddities. I recently removed one for IE on Mac. :shifty:

Don’t forget Safari on Windaz. :laughing:

2 Likes

I used to like Win Safari but could never understand why anyone would install IE on a Mac!

Did anyone?

I’m not sure but I always added the extra CSS to ensure my sites worked in IE on Mac, even though I had no way of testing it!

Just found it. Not very pretty

/* IE bug fix; hide from mac \*/
* html #footer { height: 1%; }
/* end hide */

Yes I had it on an old mac and Ie5 on a mac was better than the windows version in some points (it used a different rendering engine compared to the widows version).

I always used the double comment hack shown above and my old demos are littered with it.:slight_smile:

Glad it died though.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.