在Bootstrap中将元素的宽度设置为100%
要将元素的宽度设置为100%,请在Bootstrap中使用 .w-100类。
您可以尝试运行以下代码来设置元素的宽度
示例
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/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.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class = "container">
<h3>Set element width</h3>
<div class = "w-100 bg-success">Normal width</div>
<div class = "w-50 bg-danger">Width is 25%</div>
</div>
</body>
</html>热门推荐
10 简短平安夜祝福语
11 送给外婆祝福语简短的话
12 田园婚礼祝福语简短精辟
13 简短祝福语唯美3字
14 姥姥祝福语简短走心
15 儿童毕业祝福语 简短6
16 国庆祝福语简短儿童
17 贺卡祝老师祝福语简短
18 祝福语简短10字圣诞