bootstrap 預定義類clearfix和visible-xs-block

1.沒使用預定義類的效果

<!doctype html>
<html lang="zh-cn">
<head>
	<meta charset="UTF-8">
	<title>bootstrap test</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum=1.0,maxmum=1.0,user-scalable=no">
	<link rel="stylesheet" href="./css/bootstrap.css">
</head>
<body>
<div class="container">
	<div class="row">
		<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3Resize your viewport or check it out on your phone for an example.</div>
		<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
		<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
		<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
	</div>
</div>
<script src="./js/bootstrap.min.js"></script>
</body>
</html>
效果圖:


2.使用預定義類

<!doctype html>
<html lang="zh-cn">
<head>
	<meta charset="UTF-8">
	<title>bootstrap test</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum=1.0,maxmum=1.0,user-scalable=no">
	<link rel="stylesheet" href="./css/bootstrap.css">
</head>
<body>
<div class="container">
	<div class="row">
		<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3Resize your viewport or check it out on your phone for an example.</div>
		<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
		<!-- Add the extra clearfix for only the required viewport -->
		<div class="clearfix visible-xs-block"></div>
		<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
		<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
	</div>
</div>
<script src="./js/bootstrap.min.js"></script>
</body>
</html>
效果圖:


發佈了25 篇原創文章 · 獲贊 8 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章