我一直在尝试从p标签中删除col 6中的空白处,以进行媒体查询,但不起作用
我已经试过了
@media (min-width:320px) and (max-width:425px) {
.col-md-6 {
/* No Space */
margin-left: 0;
}
}
发布于 2019-09-02 14:49:23
它没有收取保证金。Col-md-6总是采用15px的左填充和右填充。
试试这个:
@media (max-width: 425px){
.col-md-6{ padding-left: 0; }
}发布于 2019-09-02 14:57:57
如果你正在使用引导列,使用padding只需为col-md-6添加类pl-0,如果你想让它在特定的屏幕宽度上,只需使用引导断点,如:pl-md-0
发布于 2019-09-02 15:03:50
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<section>
<div class="container">
<div class="row no-gutters">
<div class="col-6 bg-danger">
<p>Lorem Ipsum</p>
</div>
<div class="col-6 bg-primary">
<p>Lorem Ipsum</p>
</div>
</div>
</div>
</section>
</body>
</html>
我们预定义的网格类中的列之间的间距可以用.no-gutters移除。这将从.row中删除负边距,并从所有直接子列中删除水平填充。
然后,您可以给div指定您想要的边距或填充。希望它能解决你的问题
https://stackoverflow.com/questions/57752199
复制相似问题