What does this CSS do?

input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}
input,textarea,select{*font-size:100%;}

This is from YUI reset css. What does * do to font size: 100%?

+5
source share
4 answers

It hack IE. The second line is correctly parsed and executed by IE 7 and below. See http://www.webdevout.net/css-hacks#unrecommended-asterisk_prefix for details .

Edit: one comment about using such (invalid!) CSS: please don't . There are many ways you can keep your CSS safe from this mess. You will never know what IE9 behavior can bring. It’s better to put these hacks in a separate CSS file, which can then be included through conditional comments .

+12

: IE6/7 font-size: inherit. , .

+2

I think it’s a hack so that this definition only applies to IE 7 or less when ignored by another browser, since the asterisk is not a legal symbol in front of the attribute name.

0
source

As already mentioned, this is a hack for specific browsers. Marc's offer is very quiet, and here is a link to give you a start:

http://www.webdevout.net/css-hacks

0
source

All Articles