【发布时间】:2021-09-02 01:25:01
【问题描述】:
我怎样才能使用tailwindcss(如屏幕截图/代码框示例)创建一个部分英雄(具有动态高度和内部容器)?红色部分必须是全屏宽度。
here you can find the solution in bootstrap/cssm but i cant do it with tailwind
【问题讨论】:
标签: tailwind-css
我怎样才能使用tailwindcss(如屏幕截图/代码框示例)创建一个部分英雄(具有动态高度和内部容器)?红色部分必须是全屏宽度。
here you can find the solution in bootstrap/cssm but i cant do it with tailwind
【问题讨论】:
标签: tailwind-css
您没有提供太多信息。我假设您需要一个可以根据屏幕自行调整的高度。
<div class="h-1/4">
Dynamic height according to screen height
</div>
编辑:
<html>
<head>
<title>tailwind section hero</title>
<meta charset="UTF-8" />
<link
href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css"
rel="stylesheet"
/>
</head>
<body>
<div class="container relative mx-auto">
<h1 class="text-7xl my-4">headline1</h1>
<p class="text-2xl my-4">this is a text</p>
<p class="text-2xl my-4">this is a text</p>
<p class="text-2xl my-4">this is a text</p>
<div class="w-screen bg-red-500">
<h3 class="text-5xl">section hero</h3>
<p>text...</p>
</div>
<p class="text-2xl my-4">this is a text</p>
<p class="text-2xl my-4">this is a text</p>
<p class="text-2xl my-4">this is a text</p>
</div>
</body>
</html>
codepen 链接:https://codepen.io/gouravthakur39/pen/mdWvNOq
不要在容器本身上应用填充。
【讨论】: