The essentials of Simple CSS Learning

Source: Internet
Author: User

This article introduces the content of the CSS simple learning points, has a certain reference value, now share to everyone, the need for friends can refer to

Reference: HTTP://WWW.W3SCHOOL.COM.CN/CSS

CSS is to let HTML elements display a more standardized thing, can be written in the tag, file header, file, browser default settings (level from high to low), can be unified specification.

Element {property: Value}

h1 {color:red; font-size:14px;}

Defines the color of text within the H1 element as red, while setting the font size to 14 pixels

The CSS is not sensitive to casing. However, there is one exception: class and ID names are sensitive to capitalization if they involve working with HTML documents.

You can group selectors so that the grouped selectors can share the same claims.

H1,h2,h3,h4,h5,h6 {  color:green;  }

All the caption elements are green.

The ID selector is defined as "#"

#red {color:red;} #green {color:green;}

The first one can define the color of the element to be red, the second defines the color of the element as Green

<p id= "Red" > This paragraph is red. </p><p id= "Green" > This paragraph is greenish. </p>

The id attribute can only appear once in each HTML document

Derived selectors: defining styles by context
ID selector: Specific ID defined style with #
Class selector:. Class name
Property selector: Define a style for the specified property

External style sheet:

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.