如何删除div周围的白色边框 [英] how to remove white border around the div

查看:65
本文介绍了如何删除div周围的白色边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从头开始开发一个网站.这是代码

<头><身体><div id="top" style="height:200px;background-color:green">

<div id="middle" style="height:800px;background-color:white">

<div id="footer" style="height:200px;background-color:green">

</html>

问题是 div 标签上方有一个空白区域.我可以使用 margin: -10px; 属性删除空白.但我不喜欢那样处理.有没有办法在 css 中以体面的方式处理这个问题?

解决方案

I am trying to develop a web site from scratch. Here is the code

<html>
<head>
</head>
<body >
<div id="top" style="height:200px;background-color:green">
</div>
<div id="middle" style="height:800px;background-color:white">
</div>
<div id="footer" style="height:200px;background-color:green">
</div>

</body>
</html>

Problem is that there is a white space around above div tags. I can remove white space using margin: -10px; property. But I don't like to handle it that way. Is there way to handle this in decent way in css?

解决方案

<body style="margin: 0;">

这篇关于如何删除div周围的白色边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆