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

How to set full screen background image in css

王林
Release: 2020-11-20 11:19:39
Original
4299 people have browsed it

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%;
}
Copy after login

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

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!

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