Bootstrap 4 .border-danger类
使用border-danger类为元素设置红色边框。
将border-danger类设置为一个元素,就像我们包含其他任何类一样:
<div class="new border border-danger"> Red Border </div>
上面,我们还设置了另一个“new”类来设置元素的样式-
<style>
.new {
width: 120px;
height: 120px;
margin: 20px;
}
</style>您可以尝试运行以下代码来实现border-danger类-
示例
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<style>
.new {
width: 120px;
height: 120px;
margin: 20px;
}
</style>
</head>
<body>
<div class="container">
<p>Rectangle with red border:</p>
<div class="new border border-danger">Red Border</div>
</div>
</body>
</html>热门推荐
10 新年祝福语给长辈简短
11 鸡年祝福语简短8字
12 高考录取庆贺祝福语简短
13 欢送会祝福语 简短
14 给老公祝福语简短2026
15 花茶礼盒生日祝福语简短
16 精简短句生日祝福语
17 美好的毕业祝福语简短
18 过年拜年祝福语大全简短