【发布时间】:2018-12-03 12:30:55
【问题描述】:
密码字段字体中出现意外的下划线 这个表单在 bootstrap 4 modal 中
<form method="post">
<div class="form-group">
<label for="username"><u>Username:</u></label>
<input type="text" class="form-control" id="username" name="username"
autocomplete="off" autofocus required>
</div>
<div class="form-group">
<label for="password"><u>Password:<u></label>
<input type="password" class="form-control" id="password"
name="password" autocomplete="off" required>
<a href="#">Forgot password?</a>
</div>
<div class="form-check">
<label class="form-check-label" for="check">
<input type="checkbox" class="form-check-input" id="check">Remember me
</label>
</div>
<center>
<button type="submit" name="login-btn" class="btn btn-success">Login</button>
</center>
</form>
HTML 代码
.form-control,.form-control:focus{
border-top: none;
border-left: none;
border-right: none;
border-bottom: 1px solid white;
border-radius: 0;
color: white;
background: none;
outline: none;
box-shadow: none;
padding: 0;
}
.form-check{
margin-top: 50px;
}
.form-check-input{
margin-top: .4rem;
width: 15px;
height: 15px;
}
CSS 我应用了 我也试过 text-decoration:none; 大部分情况下我可以说这是 不是边框。输入字段边框是白色的
【问题讨论】:
-
如果您也可以发布您的代码会更容易,默认情况下它不会添加任何下划线,必须针对您的情况。在nicesnippets.com/live/…查看工作演示
-
欢迎来到 StackOverflow!为了让我们更好地帮助您,您能否更新您的问题,以便它显示您的现有代码并在minimal, complete, and verifiable example 中详细说明任何失败的attempts made so far,并清楚说明您想要什么结果是。如需更多信息,请参阅有关how to ask good questions 的帮助文章,并采取tour of the site :)
-
请给我们密码字段的css和html代码。还要查找在其父容器之一上设置的
text-decoration: underline;css 属性。 -
我已经用代码更新了我的帖子。
标签: forms bootstrap-4