我有一个网页,需要建立响应。
下面是一个片段的部分问题:
<div class="container-fluid">
<div class="row p-3 p-lg-5">
<div class="col">
Some text
</div>
<div class="col">
More text
</div>
</div>
</div>
我需要行在移动的设备上的填充为3,在桌面设备上的填充为20%。我还需要行的最大宽度为70%时,在桌面和100%时,在移动的上。
如何使用bootstrap-5实现这一点?
1条答案
按热度按时间a1o7rhls1#
您可以在bootstrap官方页面Bootstrap Spacing Classes找到解决方案
对于xs,类的命名格式为{property}{sides}-{size};对于sm、md、lg、xl和xxl,类的命名格式为{property}{sides}-{breakpoint}-{size}。
其中,财产是以下之一:
m -用于设置边距的类p -用于设置填充的类其中sides是以下之一:
t -对于设置margin-top或B的类b -对于设置margin-bottom或padding-bottom s的类-(start)对于在LTR中设置margin-left或padding-left,在RTL中设置margin-right或padding-right的类e -(end)对于在LTR中设置margin-right或padding-right的类,RTL中的margin-left或padding-left x -对于同时设置 *-left和 *-right y的类-对于同时设置 *-top和 *-bottom blank的类-对于在元素的所有4个边上设置边距或填充的类,其中size是以下之一:
0 -用于通过将边距或填充设置为0来消除边距或填充的类1 -(默认)用于将边距或填充设置为$spacer * .25的类2 -(默认)用于将边距或填充设置为$spacer * .5的类3 -(默认)用于将边距或填充设置为$spacer的类4 -(默认)用于将边距或填充设置为$spacer * 1.5的类5 -(默认)用于将边距或填充设置为$spacer * 3 auto的类-用于将边距设置为auto的类