繁体   English   中英

如何使用 css 在网页中制作没有空白的框?

[英]How can i make box with no white space in webpage with css?

web 页面的左右边距显示空白,这是背景的颜色,我想删除它,如何?

这是我的 css:

.box-one {
    background-color: #c8d6e5;
    height: 300px;
    width:200;
    margin-top: 1200px;
    margin-left: 40px;
    margin-right: 40px;
    margin-bottom: 29px;
}

只需添加font-size: 0即可删除所有空格,包括文本。

但是,如果您要维护文本,请尝试padding: 0

width:auto;

并删除左右边距并添加填充!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM