MENU service case
 Website construction website design Beijing website construction high-end website production company Shangpin China
We create by embracing change
360 ° brand value__
simplified Chinese character
Simplified Chinese English

Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction

Type: Shangpin Dynamic Learn more

What are the syntax structures of css

Source: Shangpin China | Type: website encyclopedia | Time: August 4, 2014
After XHTML Website production Basic knowledge, the next step will be CSS. When CSS is applied to XHTML, the first thing to do is to select an appropriate selector, which is a way for CSS to control objects in XHTML documents. In short, it is used to tell the browser which object the style will be applied to.

CSS properties and selectors

The syntax structure of CSS consists of only three parts: Selector, Property and Value.

usage method:

Selector {Property:Value;}

Selectors, also known as selectors, refer to the objects to be targeted by this group of style codes. They can be an XHTML tag (such as body, h1), or a tag that defines a specific ID or class of T (such as # main, where selectors indicate the selection of<div id="main">, that is, an object with an ID named main). The browser will strictly parse CSS selectors, and each set of styles will be applied to the corresponding objects by the browser.

Property is the core of CSS style control. For all the XHTML tags, CSS provides rich style properties, such as color, size, positioning, floating mode, etc.

Value refers to the value of an attribute. There are two forms. One is the value of a specified range (for example, the float attribute can only be used with three values: left, right, and none), and the other is a value (for example, width can be specified with 0-9999px or other mathematical units).

In practical applications, we often use the following types of applications:

body {background-color:blue;}

It indicates that the selector is body, that is, the<body>tag in the page is selected, and the attribute is background color. This attribute is used to control the background color of the object, and its bit is blue. It can be seen that the background color of the body object in the page is defined as blue by using this group of Css codes.

In addition to the definition of a single attribute, you can also define one or more attributes for a single label. Each attribute is separated by a semicolon.

Type Selector

The body {} above is a type selector. The so-called type selector refers to the selector of the name based on the existing tag name in the web page. Body is a tag name in the web page, so is div, and span is no exception. Therefore, the following selectors are type selectors, which will control all body (there is only one body naturally). div or span in the page
body{}
div{}
span{}
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).
TAG label:

What if your website can increase the number of conversions and improve customer satisfaction?

Make an appointment with a professional consultant to communicate!

* Shangpin professional consultant will contact you as soon as possible

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]

Communicate with professional consultants now!

  • National Service Hotline

    400-700-4979

  • Beijing Service Hotline

    010-60259772

Please be assured to fill in the information protection
Online consultation

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]