How to Use CSS to control the display style of webpage fonts _ experience exchange

Source: Internet
Author: User
How to Use CSS to control the display style of Web Fonts. HTML only has the following labels for <font> content </font>: <font color = colorvalue size = fontsize face = font> </font>, CSS extension specifications for <font> content </font> allow us to set the font in more detail. Font-family: font name 1, font name 3, and font name 3. Display the priority of the font. If this font is installed on the computer, it is displayed as this font. If none of the client's computers have been installed with the fonts you have set, the browser's preset fonts will be displayed: font-size: 18pt | 120% | xx-small | s-small | medium | large | x-large | xx-large

There are two methods to strictly define the font size:

1. Absolute
For example, pt; in is fixed and will not be changed due to resolution ..

2. Relative
For example, px; em; % will change with the resolution and current font size...

Font-style: normal | italic | oblique
Italics
Font-weight: normal | bold | lighter | bolder | 100-900
Font width
Font-variant: normal | small-caps
Lowercase letters to lowercase letters

For the above applications, you can use any of the [CSS overwrite] Methods ..
For example:

The following is a reference clip:
<Html>
<Head>
<Title> </title>
<Style>
Span {font-size: 20pt;
Font-color: purple;
Font-variant: small = caps;
}
</Style>
</Head>
<Body>
<Span> Dhtml & Asp </span>
</Body>
</Html>


In this way, the font displayed will be 20 PT, purple, and lowercase letters converted into smaller uppercase letters. You can also set it as follows:

The following is a reference clip:
<Html>
<Head>
<Title> </title>
</Head>
<Body>
<Span style = "font-size: 20pt; font-color: purple; font-variant: small-caps"> Dhtml & Asp </span>
</Body>
</Html>
In this way, the font size is also 20 PT, purple, and lowercase letters are converted into smaller uppercase letters.

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.