How to make a div fill the entire screen (css)

不言
Release: 2018-05-09 11:41:08
Original
4673 people have browsed it

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
Copy after login

2. Let p fill the screen by setting the width and height of html and body

1  16 17  18 
19
Copy after login

The above is the entire content of this article, more For related content, please pay attention to the PHP Chinese website.


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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!