How to Use CSS to control the display style of webpage Fonts

Source: Internet
Author: User

For HTML, the <font> content </font> label is only set to <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.

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.