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?
SamA74
November 7, 2016, 4:13pm
2
Looks like some form of clearfix to me, an odd selector though.
1 Like
PaulOB
November 7, 2016, 4:15pm
3
Yes its the old clearfix technique.
I guess the head+body was to exclude old IE6 but wasn’t necessary.
3 Likes
SamA74
November 7, 2016, 4:19pm
4
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.
SamA74
November 7, 2016, 4:22pm
6
Gandalf:
IE on Mac
Don’t forget Safari on Windaz.
2 Likes
I used to like Win Safari but could never understand why anyone would install IE on a Mac!
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!
Gandalf
November 7, 2016, 5:29pm
10
Just found it. Not very pretty
/* IE bug fix; hide from mac \*/
* html #footer { height: 1%; }
/* end hide */
PaulOB
November 7, 2016, 5:44pm
11
SamA74:
Did anyone?
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.
Glad it died though.
2 Likes
system
Closed
February 7, 2017, 12:45am
12
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.