Javascript to change the font size method set original

Source: Internet
Author: User

The first method is to control the font size of the text, which is divided into big, medium, and small. Generally, You need to specify the id
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional. dtd "> <ptml xmlns =" http://www.w3.org/1999/xhtml "> <ptmL> <pead> <meta http-equiv =" Content-Type "content =" text/html; charset = gb2312 "/> </pead> <style> # content {font-size: 12px; line-height: 200%; padding: 10px ;} </style> <body> Font: www.jb51.net. </Body> </ptmL>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
The second method is rarely used and can be used for special purposes. This is to set all the size settings in the body. It is inferior to the above Code to control the font size of the body. You can choose one based on your needs. Pay attention to multiple tests.
<Style>. tabfont {font-size: 12px }</style> <body> + font size | + font size reduction home of scripts www.jb51.net this is to set all the size settings in the body, it is inferior to the above Code to control the font size of the text. You can choose one based on your needs. Pay attention to multiple tests. </Body>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Method 3: There are only two ways to increase or decrease the number, but it is very practical. This method is also used on this site.
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <ptmL> <pead> <meta http- equiv = "Content-Type" content = "text/html; charset = gb2312 "/> </pead> <style> # content {font-size: 12px; line-height: 200%; padding: 10px ;} </style> <body> Font: [Increase or decrease] script home test text Code </body> </ptmL>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Related Article

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.