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
WBOYOriginal
2016-06-24 11:56:12927browse

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;"/>

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