Home  >  Article  >  Web Front-end  >  How to set full screen background image in css

How to set full screen background image in css

王林
王林Original
2020-11-20 11:19:394267browse

How to set a full-screen background image in css: You can use the background attribute and overflow attribute to set it, such as [overflow:hidden; background-position:center center;].

How to set full screen background image in css

body, html settings

(Learning video sharing: css video tutorial)

html,body{
    height: 100%;
}

Settings for the div where the image is located

.wrapper{
    background:#000000 url("../../img/login/login.jpg");
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    overflow: hidden;
}

Related recommendations: CSS tutorial

The above is the detailed content of How to set full screen background image in css. 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