HTML static Web page (CSS style sheet) landscaping

Source: Internet
Author: User

CSS (cascading style Sheet, overlay style sheet), the role is to beautify the HTML page.

/* Comment Area */This is the comment syntax

One, style sheet

(i) Classification of style sheets

1. Inline style sheet

Combined with HTML display, the control is accurate, but reusability is poor, redundancy is more.

Example: <p > Inline style sheet </p>

2. Inline style sheet

embedded in a Web page as a separate area, it must be written in the head tag.

<style type= "Text/css" >

P//format works on P tags

{

Style

}

</style>

3. External style sheet

Create a new CSS file to place the style sheet. If you want to call a style sheet in an HTML file, you need to right-click in the HTML file to →css the style sheet → attach the style sheet. The link connection method is generally used.

Some labels have default margins, which are usually removed when writing style sheet code (and other styles can be set), as follows:

(ii) selectors

1. Tag Selector. Use the tag name to make the selector.

2.class Selector. It's all about "." Beginning.

3.ID Selector. Start with "#".

<div id= "style name" >

4. Composite Selector

(1) separated by "," to indicate juxtaposition.

(2) separated by a space, indicating descendants.

(3) filter ".".

Two, style properties

(i) Background and prospects

1. Background:

2. Foreground font:

(ii) Borders and borders

Border (table border, style, etc.), margin (out-of-table spacing). Padding (content and cell spacing).

(c) List and block

width, height, (top, bottom, left, right) are useful only in the case of absolute coordinates.

HTML static Web page (CSS style sheet) landscaping

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.