This article mainly introduces the method (css) of making div fill the entire screen. It has a certain reference value. Now I share it with you. Friends in need can refer to it.
There is only one in the body When p, you can use this method to make p fill the entire screen.
1. Set positioning for p.
Review——
There are five attributes of position in css:
Static: Default value, No positioning
Absolute: Absolute positioning, positioning relative to the parent element
## Relative: Relative positioning
Fixed: Fixed positioning, positioned relative to the browser window
Inherit: Inherit positioning information from the parent element
In addition to the default values static and In addition to inherit, adding the other three can achieve window adaptation. The code is as follows:1 14 15 16 17 18 19 20
1 16 17 18 19
The above is the detailed content of How to make a div fill the entire screen (css). For more information, please follow other related articles on the PHP Chinese website!