Get the App
SLTechnology News&Howtos  ›  Development  › 

What is css?

Shulou Source: shulou.com Published: 2022-06-03 13:49:01 11月14日 Update

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.

Tags: Element selection size content dynamic attributes browser link browse beginning article more style knowledge article good difficult one line representative example Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Apple macOS Huawei Microsoft