Learn HTML section three. Close to the point: HTML style-css cascading style sheets

Source: Internet
Author: User

CSS (cascading style Sheets) cascading style Sheets

inline style

    • Inline style-Use the Style property in HTML elements

The way to use inline styles is to use style attributes in related tags. Style properties can contain any CSS properties. The following example shows how to change the color and left margin of a paragraph

<p style= "color:blue;margin-left:20px;" >this is a blue paragraph and with 2 blank in the left.</p>

Font-family: Font

Color: Font Color

Font-size: Font size for example: font-size:16px

Margin-left: Left Indent

Text-align: Text alignment

Background-color: Background color

Practice:

<! DOCTYPE html>
<meta charset= "Utf-8" >
<title> I want to learn html</title>
<body style= "Background-color:yellow;" >
<H1 style= "Text-align:center;color:green" > Overall background for medium yellow

<p style= "Background-color:green;" > This is a green-background paragraph. </p>

<a href= "http://www.cnblogs.com/thomason/" > used a tag and href attribute, link to my blog </a>
<p style= "color:blue;margin-left:20px;" >this is a blue paragraph and with 2 blank in the left.</p>
</body>

External style sheet

To change the appearance of multiple pages throughout the site, use an external stylesheet, using the <link rel= "stylesheet" type= "Text/css" href= "... css" > tags, but these haven't been learned yet.

Learn HTML section three. Close to the point: HTML style-css cascading style sheets

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.