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 is css?

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

Share

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

This article will explain in detail what is css, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Chapter 1 css and documentation

1, element: replacement element (img input), non-replacement element (most span).

2Linklink text/css rel (representative relationship: stylesheet, candidate stylesheet: alternate stylesheet); type (text/css); media: (all (all presentation media, screen,print), title (for candidate use).

3The perfect import url (sheet1.css) needs to be used in style, before other css rules.

4, backward accessibility: this way older browsers will ignore style, and browsers that understand css can read stylesheets normally.

5Perfect CSS comment: / * * /.

Chapter 2 selector

1. When grouping declarations, be sure to use semicolons at the end of each declaration.

2P.warming.help {background:red;} matches only p elements of class that contain warming and help, but not if p contains warming and others.

3. In fact, browsers do not check the uniqueness of id in html, but this makes it more difficult to write dom.

4, attribute selector: H2 [class] {.}

H2 [class=''] {...} is an exact match

H2 [class~=''] {...} partially matches all elements of what begins [class$=''] and ends [class*='']

* [lang | = 'en'] A specific attribute selector selects all elements whose lang attribute equals en or begins with en-.

5. Select the child element: H2 > strong; select the neighboring sibling element H2 roomp (H2 and p have a common parent element, and finally choose p).

6, link pseudo-class: unvisited link: link, visited link: visited (they are all static), equivalent to.

Dynamic pseudo-class: focus: focus, mouse hover: hover, activation: active. (dynamic pseudo-classes can be used for any element)

The pseudo-class order is recommended: link-visited-focus-hover-active.

Choosing the first child element (: first-child) is easy to misunderstand and is all the first child elements (in the following example, the element as the first child element includes the first p, the first li and strong, and em).

XML/HTML Code copies content to the clipboard

Helooo

111 222

three hundred and thirty three

Depending on the language choice (: lang ()), such as *: lang (fr) {color:red;}, this turns all French elements red.

Pseudo element selector: initials: first-letter, user agent dynamically forms false elements

First line: first-line

Before and after: before: after

On what is css to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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

*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