<div class="row mg-b-25">
<div class="col-lg-4">
<div class="form-group">
<input class="form-control" type="text" name="category_name" id="category_name" placeholder="Enter Category *" maxlength="50" required>
</div>
</div>
</div>
我想当我专注于输入字段而不是占位符更改为浮动标签
3条答案
按热度按时间nwwlzxa71#
您可以使用CSS:focus选择器和CSS::placeholder选择器
参考:
sgtfey8w2#
尝试以下浮动标签示例:
https://stackblitz.com/edit/css-image-filter-efmtr9?file=index.html,styles.css
myzjeezk3#
以下是使用Materialize的示例
这个例子工作Here,但我不知道为什么它不工作的代码片段。