我连续显示3个按钮。我讨厌在较小的屏幕上查看它,它迫使第3个进入新行。
有没有办法通过使用宽度来防止它%
?33.333%
(因为有3。)
我已经在本地尝试过,但似乎没有用。
<h1>
<a href="/norden/create/poop" class="btn btn-md btn-warning"> poop <img class="logIcon" src="/assets/be/img/norden/poop.png" /> </a>
<a href="/norden/create/pee" class="btn btn-md btn-info"> pee <img class="logIcon" src="/assets/be/img/norden/pee.png" /> </a>
<a href="/norden/create/feed" class="btn btn-md btn-success"> feed <img class="logIcon" src="/assets/be/img/norden/feed.png" /> </a>
</h1>
在h1中添加这些样式
/*your proper h1 selector*/ {
display: flex;
justify-content: space-between; /* or space-around or space-evenly depending on your preference */
}
如果你想让它包裹在非常小的屏幕上添加flex-wrap: wrap;
,以及
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句