CSS Tutorial CSS Application _ Basic Tutorial

Source: Internet
Author: User
One, in-line in line

Inline styles are used directly in HTML tags using the Style property


Text


Set paragraph text red.
But keep in mind that the final HTML should be independent and use presentation documents, so the inline style should be avoided anywhere.

Second, Internal internal

The internal style of the implant used throughout the page is inside the head tag, and the style tag surrounds it.


"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >


<title>CSS Example</title>

...
All paragraph text red, link blue.
Like the inline style, you should keep the HTML and CSS separate, so we're left with the savior.

Third, external

External styles are used throughout the Web site for multiple pages. It is a standalone CSS file, as in the following:


p {
color:red;
}

A
Color:blue;
}
If the above is saved as "Web.css", the HTML link is like this:


"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >


<title>CSS Example</title>

...
The next tutorial will talk about other methods of outreach style, which are now sufficient.

From this guide, we will follow the above method to experiment with code is a good idea, with a text editor to create a new file, saved as "Web.css" in the HTML directory.


"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >


<title>My First Web page</title>


...
Save the HTML file, now linked to the CSS, but now the CSS is empty, no content will not change the HTML. When you start learning CSS, you can add code to the CSS file to see the results of the HTML refresh.
  • 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.