Home >Web Front-end >HTML Tutorial >Novices seeking advice on details_html/css_WEB-ITnose
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:
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;"/>