Using CSS in HTML--defining CSS styles

Source: Internet
Author: User

CSS: Cascading style Sheets (cascading style sheets)

There are three ways to embed CSS in XHTML pages. See CSS Tutorials.

1. Loading a CSS file example in the head tag
<head>    <linkrel="stylesheet"type="text/css"href="style.css"/></head>

This example uses the link tag.

{font-size:12px;}{font-size:10px;color: #FFFFFF;}

Style.css's Content

2. Write CSS content directly in the head tag of the HTML file example
<head>    <styletype="text/css">    abbr    {        font-size: 12px;    }    .text10pxwhite    {        font-size: 10px;        color: #FFFFFF;    }    </style></head>

This example uses the style label.

The two approaches are the same (but the first approach is recommended, and I'll tell you why in the CSS tutorial).

3. Use the Style property to load a style sample for a label
<pstyle="font-size: 12px;color: #000;">使用css</p>

This example uses the label's style property.

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.