Select and input do not inherit the font-size of the font.

Source: Internet
Author: User
  <!  Doctype html  >  
< Html Lang = "ZH-Hans-CN" >
< Head >
< Meta HTTP-equiv = "Content-Type" Content = "Text/html; charsets = UTF-8" />
< Title > Test </ Title >
< Style >
Body
{
Font-size : 16px ;
}
Select, input
{
Font-size : 1em ;
}
# Page
{
Width : 600px ;
Margin : 0 auto ;
}
</ Style >
</ Head >
< Body >
< Div ID = "Page" >
Chinese characters
< Form >
< Select >
< Option > Chinese characters </ Option >
< Option > English </ Option >
</ Select >
< Input Type = "Text" Value = "Chinese characters" />
< Input Type = "Submit" Value = "Chinese characters" />
</ Form >
< Div ID = "Footer" >
< Form ID = "Change_ui" Method = "Get" Action = "#" >
Page width: < Input Type = "Text" ID = "Page_width" Name = "Page_width" Value = "960px" />
Font Size: < Input Type = "Text" ID = "Font_size" Name = "Font_size" Value = "20px" />
< Input Type = "Submit" Value = "OK" />
</ Form >
</ Div >
< Script Type = "Text/JavaScript" >
Document. getelementbyid ( ' Change_ui ' ). Onsubmit = Function ()
{
Document. getelementbyid ( ' Page ' ). Style. Width = This . Page_width.value;
Document. Body. style. fontsize = This . Font_size.value;
Return False ;
}
</ Script >
< Div >
</ Body >
</ Html >

In Firefox 3.6.9, ie 9, and IE 8, select and input do not inherit the font size, no matter how much font-size is declared in the body, select and input are still displayed as the default font size of the browser (generally 16px ).

So write CSS:

 
  Select, input
{
Font-size: 1em;
}

 

The overall amplification of Firefox and IE 8 can all be used to zoom in select and input. Why cannot this problem be inherited? Strange.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.