Home > Article > Web Front-end > How to set full screen background image in css
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;].
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!