CSS3: Chapter I & Chapter II & Chapter III

Source: Internet
Author: User

The first chapter:

1.<cite> tags can not only set the page as italic, but also to mark the title, making it easy to search by the search engine.

Chapter II:

1.import instruction Link Style sheet:

The CSS itself has a way to add an external style: @import instructions. Add this command to an HTML <style> tag, like this:

< style >     @import url (css/styles.css); </ style >

To place all @import rows before the CSS rule.

Chapter III:

1. Class selector naming allows only alphanumeric hyphens (-) and underscores (_), and the name must always start with a letter.

2. Class names are case-sensitive.

3. Pseudo-element: First-letter Select the first letter in the paragraph, fitst-line select the first line in the paragraph.

4.: Before and: Usage of After:

(1): Before can add content in front of the specified element. For example, to put "hot TIP" in the label containing the. Tip class, you can write this:

. Tip:before{content: "Hot tip! "}

(2): After can add content after the element.

5.::selection adds a style to text when you click and drag text, such as when you copy text, make the selected text white with a purple background, and add the following style:

:: selection{  color: #ffffff;  Background-color: #993366;    }

The selector can only set both the color and Background-color properties, and must use a double colon.

6. Pseudo-Class:

(1): First-of-type

Acts on a child element with a special label. For example, suppose you have a sidebar element that has a class name of sidebar. To define a style for the first paragraph in the sidebar, you can use this selector:

The. Sidebar P:first-of-type represents the first P label under the Sidebar class.

(2): Last-of-type

Contrary to: First-of-type effect.

(3): Nth-of-type

Used for specific label alternating sub-labels. Suppose you want to let the picture alternately float around, you can do it in the following two styles:

Img:nth-of-type (odd) {float:left;}

Img:nth-of-type (even) {float:right;}

CSS3: Chapter I & Chapter II & Chapter III

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.