Home > Web Front-end > HTML Tutorial > Novices seeking advice on details_html/css_WEB-ITnose

Novices seeking advice on details_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:56:12
Original
931 people have browsed it

In the page I designed, let the left and right sides of the body be left blank and filled with other colors, but there is still a gap at the top and bottom. How about placing the top and bottom of the image on top, and then use some CSS codes as follows:


Reply to discussion (solution)

Set the background on a div

<style>*{margin:0px;padding:0px;}</style><script>window.onload=function(){document.getElementById('a').style.height=document.body.clientHeight+'px'}</script><div id="a" style="width:900px;margin:0 auto;background:red;height:600px;"/>
Copy after login

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