html development core display, overflow, position

html development core display, overflow, position

Insert picture description here

display

Insert picture description here
Insert picture description here

To put it bluntly, it is to determine your input, whether it is a line or a block, or an in-line block, etc.···It determines what kind of form your div or something else exists on this page, and the block block occupies a whole Lines, set after inline are called inline elements, that is, line by line. The blank position does not occupy the position, but the block has blank lines (for example, the same line or multiple lines have pictures on the left and blanks on the right. The block is all occupied, not Let others place things], take it all! Inline-block can set the length and width attributes.

overflow

Insert picture description here
Insert picture description here

To put it bluntly, your picture is bigger than your div frame, what should I do? This is how I set the properties, but generally I don’t want my pictures to be larger than the frame, and then it’s ugly to look beyond. You can take a look at my other article about how CSS picture adaptive is done

position

Insert picture description here
Insert picture description here

relative

Insert picture description here

relative needless to say

absolute

Insert picture description here

The difference between absolute and fix is
Insert picture description here
shown here.

Insert picture description here
Insert picture description here

Scroll down and see that absolute can be scrolled, just absolute positioning.

fixed

Insert picture description here
Can't scroll! Can't see it!

sticky

There is also a sticky attribute

Insert picture description here

It is mostly used as a navigation bar

Insert picture description here

Second look

Insert picture description here
Insert picture description here
Insert picture description here
Explain that after the position is specified, the element is in a floating state and does not occupy a position!

Guess you like

Origin blog.csdn.net/XRTONY/article/details/115230893