简体   繁体   English

无法使用 tailwindcss 垂直增加高度

[英]Not able to increase height vertically using tailwindcss

I am not able to increase the size of block vertically.我无法垂直增加块的大小。

Actually, I want to increase the size of div vertically when increase the size of the window from small device to the higher.实际上,当将 window 的大小时从小型设备增加到更高时,我想垂直增加div的大小。

This is my tailwindcss playground link这是我的 tailwindcss 游乐场链接

https://play.tailwindcss.com/9Bs25IUgOu https://play.tailwindcss.com/9Bs25IUgOu

Can Anyone please tell me how can I do so?谁能告诉我我该怎么做?

I want to increase the size of background image as well as height of block while increasing the window size.我想在增加 window 大小的同时增加背景图像的大小以及块的高度。

change your first line of code from更改您的第一行代码

<div class="---">

to

<div class="---" style = "height: 100vh;">

Try this,试试这个,

<div class="flex flex-col w-full bg-right-bottom bg-no-repeat bg-cover min-h-small bg-star-pattern-small">
  <div class="px-3 py-5 mx-4 text-center">
    <div>
      <h1 class="pt-5 text-2xl font-medium md:text-4xl lg:text-5xl xl:text-6xl">FREE COFFEE</h1>
      <h1 class="text-2xl font-medium leading-9 md:text-4xl lg:text-5xl xl:text-6xl">IS A TAP AWAY</h1>
    </div>
    <h3 class="mt-4 text-sm md:text-lg lg:text-xl xl:text-2xl">Lorem ipsum dolor sit amet consectetur.</h3>
    <button class="mt-8 bg-green-700 rounded-2xl">
      <p class="p-2 px-4 text-sm md:text-lg lg:text-xl xl:text-2xl font-semibold text-white">Join in the app</p>
    </button>
    <p class="mt-3 underline"><a href="#">or join online</a></p>
  </div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM