Get the App
SLTechnology News&Howtos  ›  Development  › 

Sorting out the basic knowledge points of CSS

Shulou Source: shulou.com Published: 2022-06-03 15:50:12 11月14日 Update

This article introduces the relevant knowledge of "sorting out the basic knowledge points of CSS". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1.CSS Foundation

CSS selector element selector: P {} id selector: # p1 {} class selector: .pre {}

2.CSS comment

Note: / * /

3.CSS size

Width: width height: height

4.CSS background

Background-color- background color background-image:url (imagepath)-picture as background url (background.jpg)-Local test background-repeat- background repeats horizontally and vertically-Parameter optional background-size: contain- background tile

5. Text

Color- text color text-align- alignment text-decoration- text modifier lineheight- line spacing letter-spacing- word spacing text-indent- first line indented text-transform- case white-space- space

6. Font

Font-size- size font-style- style font-weight- thick and thin font-family- font font- declared together

7. Mouse styl

Cursor:crosshair- Cross cursor:pointer- finger

8. Form

Table-layout:automatic | fixed- table layout border-collapse:separate | collapse- table border

9. Frame

Border-style- border style border-color- border color border-width- border width border- are all put together boder-top- has only one direction with borders boder-top,border-left- bordered edges have borders div- block-level elements (auto-wrap) span- inline elements (no line breaks)

10. Inner margin

Padding-left: left inside distance padding-right: right inside distance padding-top: top inside distance padding-bottom: bottom inside distance padding: upper right lower left

11. Outer margin

Margin-left: left outer margin margin-right: right outer margin margin-top: upper outer margin margin-bottom: lower outer margin

twelve。 Frame model

13. Hyperchain state

Link-initial state, never accessed visited-visited hover-mouse hovering over hyperlink active-left mouse button clicked down, but not yet up

14. Hide

Display:none;-hides an element that will no longer occupy the original space "pit" allows visibility:hidden;-; to hide an element that continues to occupy the original space, but is "invisible"

15.css file

The path that href points to is a separate css file path.

16.CSS priority

Using! important after the attribute overrides the element style defined anywhere on the page. Style id selector class selector tag selector wildcard selector browser customization or inheritance "CSS basic knowledge collation" as the style attribute is written in the element. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Elements borders selection background knowledge basics styles tables colors mouse knowledge points content width dimensions attributes files text orientation more comments Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Redmi Apple Huawei vpn