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

How to make html background image full screen

angryTom
angryTomOriginal
2020-03-06 17:31:0312390browse

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%
}

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%;
}

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!

Statement:
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