简体   繁体   English

如何删除边框和内部内容之间的空间?

[英]How to remove space between border and inner content?

This is from Firefox, and there is no space这是来自 Firefox,没有空格图片1This is from Android Chrome, and there is no space这是来自Android Chrome,没有空格图像2And this is from Chrome, and there is space这是来自 Chrome 的,还有空间图像3

Here is the white space这里是空白
i have added green color section code and white box code also我还添加了绿色部分代码和白框代码

.details section:last-child {
    position: absolute;
    flex-direction: row;
    display: flex;
    width: 100%;
    bottom: 0px;
}

and below is the CSS code下面是CSS代码

.channel {
    border: 1px solid rgba(130, 130, 130, 0.8);
    margin-bottom: 20px;
    position: relative;
    border-radius: 4px;
    margin-left: 20px;
    height: 266px;
    width: 260px;
}

Have you tried to set the padding to 0px as it is what (should) define the space between the inner content and the border as you can see here when you hit F12 (at least on firefox).您是否尝试将填充设置为 0px,因为它是(应该)定义内部内容和边框之间的空间,正如您在点击 F12 时看到的那样(至少在 Firefox 上)。 项目的边距边框和内边距的视图

You could do it by adding the following line to your CSS code:您可以通过在 CSS 代码中添加以下行来实现:

padding: 0px;

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

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