HTML and CSS related points

1. The text-index attribute is used to specify the indentation of the first line of text. Usually the first line of the paragraph is indented
through this attribute. The first line of all elements can be indented to a given length. It can even be negative.
There are two ways of writing, one is

text-index:10px

The other is that em is a relative unit, which is the size of one text of the current element. If the font size of the current element is not set, it will follow the size of one text of the parent element.

text-index:2em

2. The line-height attribute , the distance between the text line and the line. The
line-height is composed of the upper and lower spacing, and the text height.
3. What are the
basic selectors of the css selector : label selector, id selector, class Selector, wildcard selector,
compound selector: consists of two or more choices.
Offspring selector (can be descendants), offspring selector (only parent-child), union selector, pseudo-class selector
Key point: Pseudo-class selector : add special effects to some selectors.
There are many pseudo-class selectors. For
example, link pseudo-classes, structural pseudo-classes and other
selectors are used: select tags.
This is a link pseudo-class , and in order to take effect, it needs From top to bottom, write
a:link links
that have not been visited a:visited links that have been visited
a:hover the link above the mouse
a:active active link (press and not be popped up)
focus pseudo-class selector : used Select the form element that has the focus

input:focus{
    
    }

4. Element display mode
Block-level elements, the default width is 100% of the container, and any label can be included. In-
line elements, width and height cannot be set. The default width is the width of its own content. In-
line block elements: the default width is the content of its own Width
5. Color semi-transparent
background: rgba(0,0,0,0.3), the last one is alpha with the same name, the value range is 0-1
6. The text is vertically centered
height>line-height text will be higher than
line-height >height text will be lower
line-height=height just in the center
7. Three CSS features:
cascading, inheritance, and priority
cascading: the same selector is set to the same CCTV, then one CCTV will cover the other conflict The style of cascading mainly solves the problem of style conflicts
. The principle of cascading is: CCTV conflicts. The principle followed is the principle of proximity. Which style is close to the structure will execute which style.
Inheritance:
line-height inheritance
body { font:12px/1.5} If the line height of the child element is not set, it will inherit the line height of the parent. At this time, the line height of the child element is: the text size of the current element*1.5 body sets the line height 1.5, the advantage of this writing method The sub-elements inside can automatically adjust the line height according to the size of their own text. Priority: inheritance selector and wildcard selector: both are 0 element selector: 1







Class selector, pseudo-class selector: 10
id selector: 100
inline style style=""1000
!important: infinity

Guess you like

Origin blog.csdn.net/qq_44073682/article/details/115158114