CSS font-size Font Text size style properties-Font size style article

Source: Internet
Author: User

First, set the font size CSS word and grammar-top BASIC syntax structure:

. divcss5{font-size:12px;}
Set the text size to 12px pixels
font-size+ Font Size value + unit

Word: font-size
Syntax: font-size:absolute-size | Relative-size | Length
Value: Xx-small | X-small | Small | Medium | Large | X-large | Xx-large
Xx-small: Min
X-small: Smaller
Small: Small
Medium: Normal (default), adjust according to font
Large: Big
X-large: Larger
Xx-large: Max
It is also advisable to specify the length unit value

Second, font-size use Method-topfont-size:12px; Set the object to a specific font size of 12px
Font-size:xx-small; Set text size to minimum
Font-size:small; Set text font size to small
Font-size:x-large; Set object font size to large
Font-size:larger; Set object font size to large
Font-size:smaller relative decrease in font size relative to parent container
font-size:50%, relative to the size of the font in the parent container, adjusted to 50% size
font-size:150%, relative to the size of the font in the parent container, adjusted to 150% size

Third, the use effect and-top corresponding CSS+DIV code:

Body Feel Music
Body Sensation Sonic

<! DOCTYPE HTML > 02.< html > 03.Font-size style settings vs. ie Browsing:


Font-size Style Properties Demo diagram

Iv. What does the font size=5 mean-top sometimes we see or encounter such as:
<font size= "5" > Content </font>
This method is also used to set the object font size directly using the font tag plus size. Here 5 represents the Set object font size of 5th words.
You can use this method to test the test such as setting size= "2", size= "3", size= "8" and so on different values observed and observed differences and grasp.

Font-size common use of CSS-top5-1, direct tags use font-size to set object content font size
<div style= "font-size:14px" > I was set font size to 14px</div>

5-2. Use tags to detach from CSS style set object content font Size Physiotherapy mattress (recommended)
CSS code:. divcss5{font-size:16px;}

Corresponding HTML div code: <div class= "DIVCSS5" > I was set by CSS font-size style font size to 16px</div>
We often use this method to set the object font size. That is, the presentation is separated from the CSS style.

Six, Font-size case-TOP1, text size case CSS code:

#divcss5 {font-size:14px;} 02..divcss5{font-size:18px;} 2, font size case HTML code:

01.<div id= "DIVCSS5" > I size for 14px</div> 02.<div class= "DIVCSS5" > I size 18px</div> 3, font-size case


Font-size Text font size case

Vii. Summary of CSS font-size-top we use CSS Font-size to set the object font size style, which generally sets the text font size to determine the object content text size in specific length unit values. In short, remember, such as CSS code FONT-SIZE:14PX, that is, set the object font size to 14px (pixels).

For style control settings for object text font size we can use font-size+ specific numbers + units to achieve text size control within an object. General font size is positive, in addition to the use of numbers and units to set the text size of the object implementation, you can also set the text size as a percentage (100%) to achieve the text font size, everyone down can try.

Extension: If you have encountered Google Chrome settings specific font size less than 12px will appear invalid settings, at this point can see the resolution of Google Browser settings text font less than 12px method

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.