簡單實(shí)現(xiàn)bootstrap選項(xiàng)卡效果
更新時(shí)間:2017年02月08日 11:57:40 作者:輕擾時(shí)光
這篇文章主要為大家詳細(xì)介紹了如何簡單實(shí)現(xiàn)bootstrap選項(xiàng)卡效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
本文實(shí)例為大家分享了bootstrap選項(xiàng)卡的具體實(shí)現(xiàn)代碼,供大家參考,具體內(nèi)容如下
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap</title>
<link rel="stylesheet" href="css/bootstrap.css" rel="external nofollow" />
<style>
.tab1{
border:1px solid #ddd;
border-top:none;
padding:30px;
border-radius:0 0 5px 5px;/*把邊框變?yōu)閳A角:top-left、top-right、bottom-right、bottom-left*/
}
</style>
</head>
<body>
<!--1.導(dǎo)航對應(yīng)的所有內(nèi)容要放到一個(gè)class為tab-content的div里;
2.每一個(gè)內(nèi)容塊兒都要加上一個(gè)名為tab-pane的class,并且給對應(yīng)的默認(rèn)顯示的內(nèi)容添加一個(gè)active的class;
3.給每一個(gè)導(dǎo)航的a標(biāo)簽添加一個(gè)data-toggle="tab"的自定義屬性;
4.給每一個(gè)選項(xiàng)內(nèi)容添加一個(gè)id;
5.給每一個(gè)導(dǎo)航的a標(biāo)簽添加一個(gè)錨點(diǎn),即在#號后加上對應(yīng)內(nèi)容的id-->
<div class="container">
<div class="row">
<ul class="nav nav-tabs">
<li><a href="#con1" rel="external nofollow" data-toggle="tab">蘋果</a></li>
<li><a href="#con2" rel="external nofollow" data-toggle="tab">香蕉</a></li>
<li><a href="#con3" rel="external nofollow" data-toggle="tab">橘子</a></li>
</ul>
<div class="tab-content"><!--選項(xiàng)卡的內(nèi)容-->
<div id="con1" class="tab-pane">html</div>
<div id="con2" class="tab-pane">css</div>
<div id="con3" class="tab-pane">javascript</div>
</div>
</div>
<div class="row">
<div class="col-lg-4"><!--讓導(dǎo)航欄只占4個(gè)格子-->
<ul class="nav nav-tabs">
<li><a href="#con4" rel="external nofollow" data-toggle="tab">蘋果</a></li>
<li><a href="#con5" rel="external nofollow" data-toggle="tab">香蕉</a></li>
<li><a href="#con6" rel="external nofollow" data-toggle="tab">橘子</a></li>
</ul>
<div class="tab-content tab1"><!--選項(xiàng)卡的內(nèi)容-->
<div id="con4" class="tab-pane">html</div>
<div id="con5" class="tab-pane">css</div>
<div id="con6" class="tab-pane">javascript</div>
</div>
</div>
</div>
</div>
<script src="js/jquery-2.1.0.js"></script>
<script src="js/bootstrap.js"></script>
</body>
</html>
效果圖:

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- 全面解析Bootstrap中tab(選項(xiàng)卡)的使用方法
- BootStrap tab選項(xiàng)卡使用小結(jié)
- bootstrap選項(xiàng)卡使用方法解析
- bootstrap實(shí)現(xiàn)tab選項(xiàng)卡切換
- bootstrap導(dǎo)航、選項(xiàng)卡實(shí)現(xiàn)代碼
- bootstrap選項(xiàng)卡擴(kuò)展功能詳解
- Bootstrap選項(xiàng)卡與Masonry插件的完美結(jié)合
- Bootstrap選項(xiàng)卡學(xué)習(xí)筆記分享
- 淺談bootstrap源碼分析之tab(選項(xiàng)卡)
- BootstrapVue選項(xiàng)卡標(biāo)題增加關(guān)閉按鈕的方法
相關(guān)文章
javascript實(shí)現(xiàn)label標(biāo)簽跳出循環(huán)操作
這篇文章主要為大家詳細(xì)介紹了javascript實(shí)現(xiàn)label標(biāo)簽跳出循環(huán)操作,感興趣的朋友可以參考一下2016-03-03
Electron 使? electron-builder 打包應(yīng)用過程詳解
Electron應(yīng)用開發(fā)中,electron-builder是一個(gè)常用的打包工具,提供了多種自定義配置,不過,使用npm安裝electron-builder時(shí)可能會遇到下載依賴慢或失敗的問題,本文給大家介紹Electron 使? electron-builder 打包應(yīng)用的相關(guān)操作,感興趣的朋友一起看看吧
2024-10-10
HTML+CSS+JS實(shí)現(xiàn)的簡單應(yīng)用小案例分享
這篇文章主要為大家分享四個(gè)用HTML+CSS+JS實(shí)現(xiàn)的簡單應(yīng)用小案例,有:猜數(shù)字、表白墻、切換日夜間模式和待辦事項(xiàng),需要的可以參考一下
2022-02-02 
