【发布时间】:2021-03-20 22:16:19
【问题描述】:
是否有一种“纯粹的 Bulma 方式”(没有自定义 css)来对齐桌面上的元素,但在小于 iPad 的设备上居中? 为了正确学习使用 Bulma,我想避免使用任何自定义 CSS。
我尝试过使用关卡,它在较小的设备上很好地居中,但在桌面上不左对齐as you can see on the screenshot. 奇怪的是它在页脚右侧按预期工作:
<footer class="section footer is-widescreen">
<div class="container">
<div class="columns">
<div class="column level-left">
<div class="buttons level-item ">
<a class="button" target="_blank" href="https://deletefacebook.com/"><img src="/placeholder/icons/facebook-f.svg" alt=""></a>
<a class="button" target="_blank" href="#"><img src="/placeholder/icons/instagram.svg" alt=""></a>
<a class="button" target="_blank" href="https://twitter.com"><img src="/placeholder/icons/twitter.svg" alt=""></a>
</div>
</div>
<div class="column has-text-centered has-text-right-tablet">
<p class="subtitle is-6">© {{ now.Year }} codeklasse</p>
<a href="https://bulma.io">
<img
src="https://bulma.io/images/made-with-bulma.png"
alt="Made with Bulma"
width="128"
height="24">
</a>
</div>
</div>
</div>
</footer>
或者,我可以将桌面上的内容左对齐,但 can't center it on mobile :
<footer class="section footer is-widescreen">
<div class="container">
<div class="columns">
<div class="column ">
<div class="buttons has-text-centered has-text-left-tablet">
<a class="button" target="_blank" href="https://deletefacebook.com/"><img src="/placeholder/icons/facebook-f.svg" alt=""></a>
<a class="button" target="_blank" href="#"><img src="/placeholder/icons/instagram.svg" alt=""></a>
<a class="button" target="_blank" href="https://twitter.com"><img src="/placeholder/icons/twitter.svg" alt=""></a>
</div>
</div>
<div class="column has-text-centered has-text-right-tablet">
<p class="subtitle is-6">© {{ now.Year }} codeklasse</p>
<a href="https://bulma.io">
<img src="https://bulma.io/images/made-with-bulma.png" alt="Made with Bulma" width="128" height="24">
</a>
</div>
</div>
</div>
</footer>
编辑:
Bulma 的创建者通过custom CSS 提供了一个解决方法。
【问题讨论】: