There are three main ways to insert style sheet.
- External style sheet
- Internal style sheet
- Inline style sheet
the priority is 3>2>1
there are four states in it.
- a:link
- a:visited
- a:hover
- a:active
in general :: is used to indicate a pseudo-element, : represents pseudo-class. if there is not a dom in your html, then you can not bind a event to it.
1rem = per unit font-size in html
indicate the CSS height and width value means the content width and height. (exclude the padding and margin)
If the height value is less than the font-size value.Then the text could not be showed completely.
em could constantly find its fathet then get a value. if we use tag in a recursing way. Then calculate the px value by em could be awful.On the contrary, using rem could be perfect.Because computing the px value by rem is simple--just multiply the html tag value with rem value.
background-size background-position
display can be flex block inline inline-block
text-overflow=ellipsis
Please change the canvas attribute(width height) and not change the css style(px)
use @media Pay attention to change the body position.
- watch out: x scroll could influence y scroll
if you want to set an item is in front of another, you'd better set the property on the brother level.
use this to figure out indicated compponent class.
Because flex and frid are really more friendly.
flex-grow: 1 means expand the space.(When other items all have the default value 0)
The element is positioned according to the normal flow of the document. The top, right, bottom, left, and z-index properties have no effect. This is the default value.
The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its initial containing block, which is the viewport in the case of visual media. Its final position is determined by the values of top, right, bottom, and left.
The element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, bottom, and left. The offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static.
The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its closest positioned ancestor (if any) or to the initial containing block. Its final position is determined by the values of top, right, bottom, and left.
This value creates a new stacking context when the value of z-index is not auto. The margins of absolutely positioned boxes do not collapse with other margins.
The element is positioned according to the normal flow of the document, and then offset relative to its nearest scrolling ancestor and containing block (nearest block-level ancestor), including table-related elements, based on the values of top, right, bottom, and left. The offset does not affect the position of any other elements.
The height of content area is only relatived with font-size and font-family.There is no relation with line-height
beware that the pseudo-class selector is recursive.
This is a very useful way.