【问题标题】:How to set vertical alignment of placeholder in tailwind?如何在顺风中设置占位符的垂直对齐方式?
【发布时间】:2022-11-22 21:13:28
【问题描述】:

我正在尝试垂直对齐第三个输入字段的占位符。假设“text-start”和“text-end”类在 tailwind 中与占位符修饰符一起使用时垂直对齐占位符文本。但奇怪的是,在我的例子中,“text-start”和“text-end”分别与“text-left”和“text-right”做同样的事情。

<div class="flex flex-col space-y-8">
              <div class="flex flex-col space-y-4 w-[540px]">
                <input class="placeholder-Eerie-Black text-[13px] font-normal tracking-[0px] leading-[15px] bg-Amber border-2 border-opacity-50 border-Eerie-Black rounded-lg h-[50px] p-2" placeholder="Name and Surname*">
                <input class="placeholder-Eerie-Black text-[13px] font-normal tracking-[0px] leading-[15px] bg-Amber border-2 border-opacity-50 border-Eerie-Black rounded-lg h-[50px] p-2" placeholder="Email*">
                <input class="placeholder:text-end placeholder-Eerie-Black text-[13px] font-normal tracking-[0px] leading-[15px] bg-Amber border-2 border-opacity-50 border-Eerie-Black rounded-lg h-[98px] p-2 text-start" placeholder="Please provide as much detailed information as possible. Thank you *">
              </div>
              <button class="bg-Green w-[210px] h-[50px] rounded-lg">SUBMIT MESSAGE</button>
</div>

【问题讨论】:

    标签: css frontend tailwind-css text-alignment text-align


    【解决方案1】:

    在对这个问题做了一些研究之后,我知道添加类placeholder:-translate-y-6 修复了这个错误。但仍然很好奇为什么提到的课程没有这样做。

    【讨论】:

      猜你喜欢
      • 2019-04-09
      • 1970-01-01
      • 2016-07-25
      • 1970-01-01
      • 1970-01-01
      • 2018-07-19
      • 2016-11-02
      • 1970-01-01
      • 2012-01-20
      相关资源
      最近更新 更多