我正在尝试将一个按钮 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>
我这里有一个正在运行的沙箱,里面有代码
最佳答案
不要使用 float-right
类,而是使用 text-right
关于css - 在不超出父 div tailwindcss 的情况下 float 右键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56233184/