CSS style Sheets

Source: Internet
Author: User

1,: Inline style sheetThat is written in the label inside solid represents a solid line, get effect modified statement widened high (note semicolon separated) to get the effect when the new set row height (line-height: "") as high as the outer border 123 appears vertically centered Then you want the 123 to appear horizontally centered then add Text-align:center (the Align attribute specifies the horizontal alignment of the content in the DIV element) and then the entire div is centered, set the margin margin:0px and set the left and right margin auto-adjust: auto 2: Inline style sheet(must be written in the head tag, because the program first read the head tag) style tag note, the type label can not write, write style only for the P tag function, directly use p write style, such as setting the background color and text size, as follows In this case, you need to add a corresponding p tag, as shown below if you set multiple p tags in body, the inline style display is summarized as follows: 3: External style sheet Note that when writing an external style sheet, an asterisk is first written by default *The margin spacing is set to 0padding pitch to 0 spacing: the distance between the P label and the p tag, such as this time * Number label equals to remove margin and spacing for all labelsCreate a new external style sheet, create a new CSS and then cut the * tag with the P tag Note because it is CSS itself, so you do not need to place a style tag, you can write the style sheet directly so after saving, the effect is as follows in HTML reference CSS style sheet, right mouse button  The following Then the link statement with the corresponding CSS is saved refreshed at this time, then the previous style appears. two selector 1. Tag Selector, that's what I said above. 2.class Selector class represents classes, with the point "." Starts with a class reference and can be referenced multiple timesFor example, setting a. AA tag in the CSS is then referenced in the second P tag in the HTML with class. AA. As follows: Display effect: summary: the. Class selector sets the label at the beginning of a point in the CSS to class= "" in the P tag of the HTML reference The 3.ID selector starts with # with an ID reference, can it be referenced multiple times? No, note that ID is a unique referenceFor example, writing an ID tag in the CSS is referenced in HTML, as follows: You cannot refer to the same ID label for both p tags, the ID can only be referenced once, and class can be multiple references 4. Composite selectors such as p tags and span tags execute this style simultaneously: in HTML: 0 effect 0 (2): where. Main represents the inside of the label referenced by Class=main (that is, the position in the middle of the two angle brackets), and if a P tag exists, the P tag executes the following style. Descendants refer to being surrounded. For example: At the same time the CSS shows the effect where the yellow content is the P tag (3) filter: This means: the P tag class equals the SP's execution of this style, for example: At the same time the HTML shows the following note: The rules that can be understood as the preceding P tags do not work ...    P tags just play a guiding role two. Style property ★★★★1. Background and foreground of style attributes

1. Background:

2. Foreground font:

(ii) Borders and borders

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

For example:

Show

(c) List and block

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


Follow the Web site link style in 360 browsers

the style of the link :

A:link Hyperlink is pre-state

a:visited Hyperlink post-click Status

A:hover hover over hyperlinks

A:active When you click the hyperlink

When you define these states, there is a sequence L v H a must be in order to

For example:

Show

After this visit, the default browsing marks are purple,

Then write a link tag in the CSS so that the link does not have an X underline (Text-decoration:none),

Write visited again.

Then write hover (mouse refers to the top, that is, the mouse hover over), the underline and the text color appears:

Then write active (action), which is the color that appears when clicked:

After saving refresh, 360 browser link style effect appears, no drawings

But as in the different colors of the link:

You need to classify it as follows

L v H A are labeled ". A1", as follows:

Then class= "A1" in HTML as follows:

Then go back to the CSS and copy a group of LVHA to A2 and change the initial color as follows:

4

Refer to A2 in HTML again, as follows

The effect is as follows

Note: Hover can also be used in other Div

For example:

Display effect: The div area turns green when the mouse is pointing, and the mouse leaves to blue. As follows

Final Mind Mapping Summary:

 

CSS 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.