我在'a'标签中包裹了一些文本,并留有一些空白。左边距帮助将其与直接位于其左侧(在桌面/平板电脑上)的按钮分开。这在台式机/平板电脑上效果很好,但是在移动设备上,“ a”标签在按钮下方向右移动,这意味着不再需要向左留空白。如何仅删除移动用户的保证金?或者,更具体地说,当'a'标签移动到按钮下方时,如何删除左边距?我已经附上了我正在谈论的内容的一些屏幕截图,以及按钮和'a'标签的代码。
2个元素的代码:
<div class="btn-group-one wow fadeInUp" data-wow-delay="500ms" data-wow-duration="1000ms">
<a class="btn saasbox-btn white-btn mt-3" href="#">WEB APP</a>
<a class="btn saasbox-btn-2 mt-3 ml-4" href="#">iOS & Android Apps Coming Soon</a>
</div>
*注意:mt-3,ml-4和ml-4“类”来自Bootstrap。 “ ml-4”为元素的左侧留有一些“ rem”边距。
移动:
桌面:
The Bootstrap margin classes have breakpoint-specific (ie screen width specific) options so you can set the margin for desktop only, eg
ml-md-4
where "md" is the medium screen width. Depending on what breakpoint forces thea
tag to wrap under the button you might have to choose "sm", "lg", etc.Full documentation at https://getbootstrap.com/docs/4.4/utilities/spacing/