Home > Web Front-end > HTML Tutorial > How to make html background image full screen

How to make html background image full screen

angryTom
Release: 2020-03-06 17:31:03
Original
12423 people have browsed it

How to make html background image full screen

How to make the html background image full screen

1. First, set the height of html and body to 100%

Recommended learning: html tutorial

html,body{
    width:100%;
    height:100%
}
Copy after login

2. Then add a background image to the body and set the background-size to 100%.

body{
  font-family: "华文细黑";
  background:url("../img/Flyer-bg.png") no-repeat;
  background-size: 100%;
}
Copy after login

For more related tutorials, please pay attention to PHP Chinese website!

The above is the detailed content of How to make html background image full screen. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template