【问题标题】:Tailwindcss - align two texts with different sizes to bottom lineTailwindcss - 将两个不同大小的文本与底线对齐
【发布时间】:2021-06-17 05:08:21
【问题描述】:

<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-bottomalign-text-bottomfloat-rightfloat-left(不使用flex),但到目前为止没有任何效果..

顺风Playground.

【问题讨论】:

    标签: html css tailwind-css


    【解决方案1】:

    您可以尝试在父级上使用items-endflex 类来解决问题。

    <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>

    Tailwind Playground

    【讨论】:

      猜你喜欢
      • 2014-10-22
      • 2021-12-20
      • 2019-05-14
      • 2013-10-25
      • 1970-01-01
      • 1970-01-01
      • 2015-06-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多