选项卡这样写更灵活-jerrylsxu
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了选项卡这样写更灵活-jerrylsxu,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2258字,纯文字阅读大概需要4分钟。
内容图文
![选项卡这样写更灵活-jerrylsxu](/upload/InfoBanner/zyjiaocheng/409/f988a06dc5a04a7e83f693dbab625923.jpg)
同样的html代码结构 配合不同的css代码 展示不一样的效果。 |
html基本结构
1
2
3
4
5
6
7
8
9
10
|
< div id="tabs" class="tabs_right"> < ul > < li >< a href=#tab1>土豪 a > li > < li >< a href=#tab2>官二代 a > li > < li >< a href=#tab3>富二代 a > li >
ul > < div id="tab1" class="tabsCont" >Contents of first tab div > < div id="tab2" class="tabsCont" style="display:none">Contents of the second tab div > < div id="tab3" class="tabsCont" style="display:none">Contents of the third tab div >
div > |
css代码1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
.tabs{ width : 400px ; height : auto ; } .tabs>ul{ width : 100% ; height : auto ; background-color : #ededed ; padding : 0 ; height : 36px ; } .tabs>ul>li{ float : left ; padding : 0 10px ; height : 30px ; line-height : 30px ; list-style : none ; margin : 6px 5px 0 5px ; background-color : #d8d8d8 ; } .tabs>ul>li>a{ color : #000 ; } |
效果如下
css代码2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
.tabs_bottom{ width : 400px ; height : auto ; border : 1px solid #ededed ; min-height : 200px ; position : relative ; } .tabs_bottom>ul{ width : 100% ; height : auto ; background-color : #ededed ; padding : 0 ; margin : 0 ; height : 36px ; position : absolute ; bottom : 0 ; } .tabs_bottom>ul>li{ float : left ; padding : 0 10px ; height : 30px ; line-height : 30px ; list-style : none ; margin : 6px 5px 0 5px ; background-color : #d8d8d8 ; } .tabs_bottom>ul>li>a{ color : #000 ; } |
效果如下
css代码3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
.tabs_left{ width : 400px ; height : auto ; border : 1px solid #ededed ; min-height : 200px ; } .tabs_left>ul{ float : left ; width : 100px ; height : auto ; background-color : #ededed ; padding : 0 ; margin : 0 ; } .tabs_left>.tabsCont{ float : left ; } .tabs_left>ul>li{ padding : 0 10px ; height : 30px ; line-height : 30px ; list-style : none ; margin : 6px 5px 0 5px ; background-color : #d8d8d8 ; } .tabs_left>ul>li>a{ color : #000 ; } |
效果如下
css代码4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
.tabs_right{ width : 400px ; height : auto ; border : 1px solid #ededed ; min-height : 200px ; } .tabs_right>ul{ float : right ; width : 100px ; height : auto ; background-color : #ededed ; padding : 0 ; margin : 0 ; } .tabs_right>.tabsCont{ float : right ; } .tabs_right>ul>li{ padding : 0 10px ; height : 30px ; line-height : 30px ; list-style : none ; margin : 6px 5px 0 5px ; background-color : #d8d8d8 ; } .tabs_right>ul>li>a{ color : #000 ; } |
效果如下
内容总结
以上是互联网集市为您收集整理的选项卡这样写更灵活-jerrylsxu全部内容,希望文章能够帮你解决选项卡这样写更灵活-jerrylsxu所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。