3 replies [Last post]
ColdFire
ColdFire's picture
Offline
newbie
Ottawa, Ontario
Last seen: 12 years 30 weeks ago
Ottawa, Ontario
Timezone: GMT-4
Joined: 2010-09-03
Posts: 2
Points: 3

Hi.

My employer created a CSS file with some weird styles that I don't understand. Maybe you can help me? Take for example the following:

body {
	margin: 0;
	padding: 0;
	color: #000;
	background-color: #FFF;
}
* html body {
	text-align: center;
}

Why is the "* html body" style not included with the one above?

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 5 years 37 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

it's an IE6 hack... probably

it's an IE6 hack... probably a misconception on how to center a design.

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

ColdFire
ColdFire's picture
Offline
newbie
Ottawa, Ontario
Last seen: 12 years 30 weeks ago
Ottawa, Ontario
Timezone: GMT-4
Joined: 2010-09-03
Posts: 2
Points: 3

Interesting! Ok. There must

Interesting! Ok. There must be a better way to deal with this? ...in the interest of the apparent requirement from my employer to still support this very old and broken browser?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 11 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

It's a very old hack used to

It's a very old hack used to get around IE in quirks mode being unable to center block elements with auto margins; it is pretty much redundant nowadays.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me