gpt4 book ai didi

css - 在不超出父 div tailwindcss 的情况下 float 右键

转载 作者:行者123 更新时间:2023-11-27 23:56:33 26 4
gpt4 key购买 nike

我正在尝试将一个按钮 float 到卡片的右侧。我希望它出现在右下角。

当我正确使用 float 时。它出现在父 div 之外,有没有办法正确定位它?

<div class="m-10">
<div>
<div class="bg-white shadow-lg border-grey w-1/3 ">
<div class="p-4 flex">
<div class="pt-3 text-center font-bold text-2xl w-16 h-16 bg-grey-lightest">
D
</div>
<div class="ml-4">
Team Name
</div>
</div>
<div class="float-right">
<a :href="'/company/' + team.id">
<button class="ml-2 bg-blue hover:bg-blue-dark text-white text-sm font-bold rounded p-2">
View
</button>
</a>
</div>
</div>
</div>
</div>

enter image description here

我这里有一个正在运行的沙箱,里面有代码

https://codesandbox.io/s/tailwind-css-nl0ph

最佳答案

不要使用 float-right 类,而是使用 text-right

关于css - 在不超出父 div tailwindcss 的情况下 float 右键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56233184/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com