【发布时间】:2021-01-22 15:52:33
【问题描述】:
我有搜索输入元素,当我在移动设备上查看它时,它超出了屏幕的宽度。我不知道为什么:
<template>
<div id="app" class="bg-gray-200 antialiased">
<section class="flex justify-between bg-gray-800 px-4 py-3 ">
<div class="relative">
<input class= "bg-gray-900 text-white rounded-lg px-12 py-2
focus:outline-none focus:bg-white focus:text-gray-500"
placeholder="Search by keywords"/>
</div>
<button>Filters</button>
</section>
</div>
</template>
感谢任何帮助。
编辑:
我试图删除设置填充的样式:
<template>
<div id="app" class="bg-gray-200 ">
<section class="flex justify-between bg-gray-800 ">
<div class=" ">
<input class= "bg-gray-900 "
placeholder="Search by keywords"/>
</div>
<button>Filters</button>
</section>
</div>
</template>
但是没有用。
我希望通过 tailwind 类来解决它,而不是求助于原始 css 解决方案。
【问题讨论】:
-
也许 id="app" 有一些 CSS 属性?
-
@aakash 不
-
你能以
jsfiddle之类的方式运行你的HTML吗?
标签: html css tailwind-css