gpt4 book ai didi

css - Bootstrap : is it possible to change the "has-error" line thickness?

转载 作者:行者123 更新时间:2023-11-28 03:38:55 25 4
gpt4 key购买 nike

你好,我在这样的输入上使用了 has-error 类:

<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<meta input1="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>
<body>

<form method="post">


<div class="col-lg-4 col-lg-offset-4 has-error">

<input type="text" name="input" class="form-control"/>

</div>

</form>

</body>

</html>

但我想增加红色边框的厚度,所以我尝试添加:

<style>

.has-error{

line-height:3px;
}

</style>

但是没有效果,请问是否可以改变这个类的粗细,如何实现呢?

谢谢

最佳答案

line-height 不是您要更改的属性,请尝试 border-width。您还需要将类指定为 .form-control,否则您的样式将不会应用。

.has-error .form-control{
border-width: 3px;
border-color: blue !important;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<meta input1="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>
<body>

<form method="post">


<div class="col-lg-4 col-lg-offset-4 has-error">

<input type="text" name="input" class="form-control"/>

</div>

</form>

</body>

</html>

希望对您有所帮助。

关于css - Bootstrap : is it possible to change the "has-error" line thickness?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44328736/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com