Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this CSS do?

Tags:

css

css-hack

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

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

like image 557
Kyle Avatar asked Jun 03 '10 22:06

Kyle


People also ask

What does CSS stand for and what does it do?

CSS stands for Cascading Style Sheet. CSS can format the document content(written in HTML or other markup language): layout. colors.

What does AT do in CSS?

At-rules are CSS statements that instruct CSS how to behave. They begin with an at sign, ' @ ' ( U+0040 COMMERCIAL AT ), followed by an identifier and includes everything up to the next semicolon, ' ; ' ( U+003B SEMICOLON ), or the next CSS block, whichever comes first.


2 Answers

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

Edit: One remark on using such (invalid!) CSS: please don't. There are plenty of ways of keeping your CSS clean of such mess. You'll never know what behavior IE9 might bring. Better to put these kind of hacks in a separate CSS file which can then be included through conditional comments.

like image 120
Marc Avatar answered Sep 21 '22 16:09

Marc


To be more precise: IE6/7 doesn't support font-size: inherit. This hack is supposed to achieve the goal anyway.

like image 39
BalusC Avatar answered Sep 21 '22 16:09

BalusC