html - Tailwindcss - 将两个不同大小的文本与底线对齐
问题描述
<div class="flex">
<div class="flex-1 text-sm bg-red-300">
<span class="align-bottom">I want this to be on the same bottom level as Right content</span>
</div>
<div class="flex-1 text-right text-5xl bg-blue-400">
Right content
</div>
</div>
我尝试了align-bottom
,align-text-bottom
或带有float-right
and的东西float-left
(不使用 flex),但到目前为止没有任何效果..
顺风游乐场。
解决方案
您可以尝试items-end
在 parent 和flex
class 上使用来解决问题。
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<div class="flex">
<div class="flex-1 text-sm bg-red-300 flex items-end">
<span>I want this to be on the same bottom level as Right content</span>
</div>
<div class="flex-1 text-right text-5xl bg-blue-400">
Right content
</div>
</div>
推荐阅读
- twilio - Twilio Taskrouter - 如何向自定义任务添加信息?
- python - 使用 PIP 安装后,Windows 上的 Visual Code 找不到模块。在终端窗口中使用错误的 Python?
- postgresql - 如何将decrypt_iv() 函数的输出格式转换为postgres 中的文本?
- c - 在具有二维数组的程序中调试 SIGABRT 错误
- sas - 按 ID 在多行上对 SAS 中的成功进行分组,其中至少 1 次成功算作成功
- node.js - typedi + fastify - 异步初始化服务
- javascript - 猫鼬检查 id 是否存在,但该 id 嵌套在数组中
- swift - Swift 和 Curl 和 SAML
- r - 使用 != 和 == 在 filter() 中不匹配
- hybris - 如何从 hybris 的本地化 .properties 文件中向属性添加参数?