Four. CSS declarations

Source: Internet
Author: User


A CSS rule consists of a selector and a declaration of two parts, and the declaration includes attributes and values, which indicate the aspect of the style to affect, and the value used to set the property to what

Each HTML element has a number of properties that can be set using CSS, but only a few of the values

The value of the CSS property

CSS property values are divided into text values, numeric values, color values

text values: also called keywords, all CSS properties have text values

P {background-color: Red}

The red above is a literal value

Numeric values: numeric values are used to describe the various "lengths" of an element, where length is a generic term, which can refer to height, width, thickness, etc., numeric values: absolute and Relative values,

The absolute value is described as a true length, whereas relative values are described relative to other benchmarks; The numeric value is followed by a unit, if 0 can be without units, such as

P {font-size: 36px}

The 36px above is a numeric value

color values: color values can be written in several different formats, such as RGB, HSL, 16 binary, etc.

Four. CSS declarations

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