Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

font-size specified on body element is ignored by input

I have a basic web page here http://www.webdevout.net/test?0V, reproduced below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
 <style type="text/css">
 body { font-size: 12px;}
 </style>
 <title>Test</title>
</head>
<body>
 <p>test</p>
 <form action="/foo" method="get">
  <fieldset>
   <input type="text" value="bar" />
  </fieldset>
 </form>
</body>
</html>

When i use firebug to inspect the page, the text "test" is 12px as expected, but the text "bar" in the input is 11px, i would expect it to be 12px. Whats going on please?

like image 928
pingu Avatar asked Dec 13 '22 17:12

pingu


1 Answers

In the browser you are using the default value for the font-size property is not inhert or a percentage, em or other relative length value. i.e. it is an absolute value.

Set the font-size property yourself, e.g. input { font-size: 100%; }

Consider using a reset stylesheet.

like image 147
Quentin Avatar answered Jan 13 '23 13:01

Quentin