bootstrap.min.css不知道为什么会出错,从中文官网下载的,用了半天之后就出错,找不到原因,从新下载了也没用 [图片] 求大佬支招,刚刚开…
顺晟科技
2021-07-09 11:25:01
194
最开始不加边框时,内部元素跟父容器还严丝合缝,但是一旦加了 border 以后,border 和 content 之间就出现了一条小缝隙,不知是什么原因,css 如下:
没加边框:
.bar-content {
    width: ;
    height: 40px;
    background-color: black;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.navigation-btn {
    flex: 1;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: whitesmoke;
    transition:background-color .2s
}
加边框:
.bar-content {
    border: 2px solid green;
    width: ;
    height: 40px;
    background-color: black;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.navigation-btn {
    flex: 1;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: whitesmoke;
    transition:background-color .2s
}
虽然看不清楚,但是边框和内容之间有一条黑线。盒模型:
可能是 HTML 绘制的时候有点色偏。
如果把 border 改大一点,比如 5;或者放大显示在 200%;应该就看不见那么黑边了(但不是,有时候刷刷还会出来,刷刷又没了)。
会不会因为width: 和border导致内容溢出,撑开有个水平滚动条?加box-sizing: border-box;看看
02
2022-12
18
2022-10
25
2022-09
16
2022-09
16
2022-09
15
2022-09