Introduction to CSS

Source: Internet
Author: User


1. Introduction to CSS

CSS (cascading style Sheets) cascading style sheet, a computer language used to control the display of HTML content

CSS pre-defines a number of style properties related to the display effect, and the control of the style is very precise and fine, such as color, font-size, and so on. If you want HTML content to display an effect, apply the corresponding CSS style property

Features of CSS

Some style attribute sub-tags can inherit from the parent tag, while others cannot

A label can apply several style attributes at the same time

The final result of a label is a cascade (overlay) of a number of style attributes to form together


2. Five ways to use CSS


(1) inline style

Write in the element's style attribute

(2) inline style

Written within the <style> element

(3) import style

Use the @import URL (index.css) in the beginning of the <style> element and introduce it in a way that actually counts as an inline style

(4) link style

Use <link> elements to introduce CSS files, such as <link type= "Text/css" rel= "stylesheet" href= "C1.css"/>

(5) default Style

Each HTML tag has a default CSS style


3. CSS Priority

When a style attribute occurs multiple times, it is necessary to use precedence rules to resolve the resulting contradiction

(1) Priority of different ingestion methods: inline > inline, Import and link > default Styles

(2) In the introduction of the same introduction method or the same priority, the latter appears to cover the first


4. Other common style attributes

Visibility of Display control elements

Cursor controls the style when the mouse pointer enters the element



Introduction to CSS

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.