MindMap Gallery Selectors for HTML and CSS
In HTML and CSS, basic selectors, compound selectors, pseudo-selectors, etc. are all important contents. This map divides these contents in detail to make it easier for you to understand.
Edited at 2021-07-26 11:47:06El cáncer de pulmón es un tumor maligno que se origina en la mucosa bronquial o las glándulas de los pulmones. Es uno de los tumores malignos con mayor morbilidad y mortalidad y mayor amenaza para la salud y la vida humana.
La diabetes es una enfermedad crónica con hiperglucemia como signo principal. Es causada principalmente por una disminución en la secreción de insulina causada por una disfunción de las células de los islotes pancreáticos, o porque el cuerpo es insensible a la acción de la insulina (es decir, resistencia a la insulina), o ambas cosas. la glucosa en la sangre es ineficaz para ser utilizada y almacenada.
El sistema digestivo es uno de los nueve sistemas principales del cuerpo humano y es el principal responsable de la ingesta, digestión, absorción y excreción de los alimentos. Consta de dos partes principales: el tracto digestivo y las glándulas digestivas.
El cáncer de pulmón es un tumor maligno que se origina en la mucosa bronquial o las glándulas de los pulmones. Es uno de los tumores malignos con mayor morbilidad y mortalidad y mayor amenaza para la salud y la vida humana.
La diabetes es una enfermedad crónica con hiperglucemia como signo principal. Es causada principalmente por una disminución en la secreción de insulina causada por una disfunción de las células de los islotes pancreáticos, o porque el cuerpo es insensible a la acción de la insulina (es decir, resistencia a la insulina), o ambas cosas. la glucosa en la sangre es ineficaz para ser utilizada y almacenada.
El sistema digestivo es uno de los nueve sistemas principales del cuerpo humano y es el principal responsable de la ingesta, digestión, absorción y excreción de los alimentos. Consta de dos partes principales: el tracto digestivo y las glándulas digestivas.
CSS selector
Introduce style sheet
1. Inline style sheets
2. Internal style sheet
3. External style sheets
Selector
basic selector
1. Universal selector *
2. Element selector h2
3. Class selector .class
4.id selector #id
compound selector
1.Intersection selector e#id || e.class
2. Union selectors e1,e2,e3
3. Descendant selector e1 e2 e3
4. Descendant selector e1>e2>e3
5. Adjacent sibling selector e1 e2
6. Universal sibling selector e1~e2
Pseudo selector
Pseudo element selector
1::first-line
2::first-letter
3 ::before; ::after
4::selection
Pseudo class selector
1. Dynamic pseudo-class selector
1:link; (link) when not accessed
2:visited; (link) after being visited
3:hover;
4:activate when activated (when the mouse is pressed)
5:focus When getting focus
2.UI pseudo-class selector
1 :enabled; :disabled
2:checked
3 :required; :optional
4:default
5 :valid; :invalid
6 :in-range; :out-of-range
7 :read-only; :read-write;
3. Structural pseudo-class selector
1:root root element selector
2: empty empty element
3
:first-child; :last-child; :only-child
:first-of-type; :last-of-type; :only-of-type
4
:nth-child(); :nth-last-child()
:nth-of-type(); :nth-last-of type()
4. Other pseudo-class selectors
1:target; page anchor point
2:lang; language
3:not(selector) Negative selector
attribute selector
1 [attr]
2 [attr="val"]
3 [attr^="val"]
4 [attr$="val"]
5 [attr*="val"]
6 [attr~="val"]
7 [attr|="val"]
CSS
color expression
RGB (RGBA)
HEX
HSL (HSLA)
background
background
background-color background color
background-image background image
background-repeat
no-repeat
repeat-x
repeat-y
space (adjust image spacing)
round (resize image)
background-position
(top, left, right, bottom, center) pairwise combination
(x% y%)
(x y)
background-origion
padding-box
border-box
content-box
background-clip
padding-box
border-box
content-box
background-size
auto (original size)
x,y (width, height)
x%,y% (percentage of parent element)
cover (adjusted to cover the entire container)
contain (adjusted to be fully displayed)
background-attachment
local (scrolls with content)
scroll (does not scroll with the content, but scrolls with the page)
fixed (fixed, uncontrolled size)
box model
margins
Percentage is a percentage of the width of the parent container
padding
margin
boundary
border border
border-width
border-color
border-style
border-raius
border-image border image
border-image-source
border-image-slice
border-image-width
border-image-outset
border-image-repeat
box-shadow
outline outline
outline-color,style,width
outline-offset (the outer offset of the outline from the border)
size
width
height
min-width (height)
max-width(height)
Application scenario?
box-sizing
margin-box
border-box
padding-box
content-box
overflow
overflow
auto
hidden
scroll
visible (default)
inherit
overflow-x, overflow-y
display
margin collapse problem
Vertical collapse (border collapse)
Nested collapse
Location
float
Several methods to clear floats:
The principle of floating
1. After the element is floated, it will break away from the document flow and increase the level.
2. The position of the element after it floats is affected by the previous floated element. If the previous element is floated and the position behind it is sufficient, it will be displayed on the same line; if the position behind it is insufficient, the element will be squeezed to the next line for display.
3. After the element is floated, if the previous element is not floated, the current element will be floated in its own row.
4. If an element is pushed to the next row after being floated, the position of the current element is affected by the previous element with the same floating direction.
Notice
1. Floating will cause the height of the parent element to collapse
2. Elements have "wrapping properties" after being floated (similar to inline blocks.)
position
Attributes
static (default, normal layout)
relative (relative positioning)
absolute (absolute positioning)
fixed (fixed positioning)
sticky (sticky positioning)
Notice
1. The later the element is positioned, the higher the level (z-index)
2. After the element is positioned, it has "wrapping properties" (similar to inline blocks.)
Clear float: clear
BFC (block-level formatting context)
1. If the following conditions are met, a new BFC will be automatically created
float attribute is not none
The position attribute is not static or relative
The overflow attribute value is not visible
The display attribute is flex, inline-flex, inline-block, table-cell or table-caption
2.BFC regulations: margin vertical collapse, nested collapse
Solution: Put the div into a different BFC
3. Methods to accommodate floating elements
1. Also set float for the container
2. Use clear to clear floats
3. Create a new BFC for the outer element
4. Use BFC to prevent text wrapping
multi-column layout
column-count: Specify the number of columns
column-width: Specify column width
columns
column-gap: column spacing
length
normal
column-fill: How content is distributed between columns
balance (content is evenly distributed)
auto (content is filled in order)
column-span: specifies how many columns the element spans horizontally
number
all
column-rule-width: Specify the width between columns
coloum-rule-style: Specify the style between columns
column-rule-color: Specify the color between columns
column-rule
Case: waterfall flow layout
Interview question: Several methods to implement multi-column layout
float
position
column
Trinity web page layout
Centered layout
inline elements
Horizontal centering: parent element text-align: center;
Vertically centered: line-height: (height);
block-level elements
Center horizontally: margin: 0 auto;
Center vertically:
STEP1: position: absolute;
STEP2: top,bottom (left,right): 0;
STEP3: margin: auto;
single column layout
two column layout
Two columns fixed width centered layout
The sidebar has a fixed width and the main content is adaptive
Use float implementation
Use positioning to achieve
three column layout
float method
absolute positioning method
Negative margin method
classic layout
Double flying wing layout
holy grail layout
waterfall flow layout
Use of negative margins
Negative margins for static elements
Top and left: Move the element itself to the upper left
Bottom and right: Let subsequent elements invade from the bottom or right to cover themselves
Negative margins for floated elements
Same as the floating direction: the element moves the corresponding distance in the corresponding direction
Opposite to the floating direction: the element itself does not move, and the elements before or after the element will move a corresponding distance in the direction of the element.
Application of negative margins
Three-column layout for lists
Flexbox layout
display (set to flexible box)
flex; (block-level flex box)
inline-flex; (inline flexible box)
flex-wrap (specify element wrap)
wrap (specify flexible element to wrap automatically)
nowrap (default value, no automatic line wrapping)
wrap-reverse (flexible elements automatically wrap in reverse)
flex-direction (specifies the direction of arrangement of elements)
row (default value, flexible elements are arranged horizontally)
column (vertical arrangement)
row-reverse (reverse horizontal arrangement)
column-reverse (vertical reverse arrangement)
Can be combined into flex-flow
Alignment of flexbox layout
Two important concepts
Main axis: specifies the order in which elastic elements are arranged.
Vertical axis: determines the direction in which elements in the second row are added after a line break occurs.
Alignment
justify-content (alignment on main axis)
flex-start (default value, the elastic element starts close to the main axis)
flex-end (the elastic element is close to the end edge of the main axis)
center (flexible element is centered on the main axis)
space-between (arrange each element evenly, with the first element close to the starting edge of the main axis, and the last element close to the ending edge of the main axis.)
space-around (All flex elements are arranged evenly, and the spacing between elements does not collapse.) (Arrange each element evenly, allocate the same space around each element)
space-evenly (All flex elements are arranged evenly, and the spacing between elements is collapsed.) (Each element is arranged evenly, with equal spacing between each element)
Alignment on vertical axis
align-items (alignment of all elements on the vertical axis)
flex-start (flexible elements start close to the vertical axis)
flex-end (the elastic element is close to the end edge of the vertical axis)
center (flexible element is centered on the vertical axis)
baseline (flexible elements are aligned to the baseline)
stretch (default value, the elastic element stretches to occupy the entire vertical axis size)
align-self (alignment on the vertical axis of an element)
align-content (alignment of multi-line flexible elements)
flex-start
flex-end
center
space-between
span-around
space-evenly
order (display order)
elasticity
flex-grow (Defines how the flex element is enlarged.)
flex-shrink (defines how flex elements are compressed)
flex-basis (flexible basis)
flex-basis sets the initial size (not width) occupied by the flexible element on the main axis.
If flex-basis and width and height are set at the same time, the latter will be automatically overwritten.
flex(0 1 auto)
Characteristics of elastic elements
1. The margins of the two elastic elements will not collapse or collapse.
2. It is invalid to set floating elements on flexible elements (but positioning can be set)
Grid layout (grid layout)
basic terminology
Grid Line
Grid Track
Grid Cell
Grid Area
display (set as grid container)
grid
inline-grid
Row & column definitions
grid-template-columns
fr (eg: 1fr 1fr 1fr; 100px 50% 1fr)
grid-template-rows
fr: The fr here is proportional to the height of the grid container. (If there is no height, it will be calculated according to the height of the content.)
Define templates based on regions
grid-template-area: needs to be used with grid-area.
Notice
1. Each line must be wrapped with a string
2. Must be rectangular.
Skill
...means to leave it blank