Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basics of CSS

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the basic knowledge of CSS". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the basics of CSS".

First, why use div+css

1. Realize the separation of performance and style

2. Good for search engine crawlers

3. Improve the speed of web page access.

4. Browser compatibility

2. Three ways of introducing css

1. Internal reference, css style written in tags in html documents

Bdoy {font-size:14px;}

2, external reference, use tags to reference external css files, and reference styles to html documents.

3, used in tags, use the style attribute to change the current tag style.

III. CSS grammar

1. Basic grammar

Selector {declaration1; declaration2;... DeclarationN}

Each declaration consists of an attribute and a value.

Property is the style property you want to set (style attribute). Each property has a value. Properties and values are separated by colons.

For example:

P {

2. CSS selector

In CSS, the class selector is displayed with a period:

Class selector, which is displayed with a period.

.center {text-align: center}

Id selector, id selector is defined by "#".

# green {color:green;}

Element selector

Html {color:black;}

Descendant selector: an element that is selected as a descendant of an element.

Div.span {background:blue;}

There are many selectors for css, such as pseudo-class selector, sibling selector and intersection selector, which will not be introduced here.

Thank you for your reading, the above is the content of "what are the basic knowledge of CSS". After the study of this article, I believe you have a deeper understanding of what the basic knowledge of CSS has, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 237

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report