zoukankan      html  css  js  c++  java
  • 选项卡这样写更灵活

    同样的html代码结构 配合不同的css代码 展示不一样的效果。

    html基本结构

    <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

    .tabs{
    	400px;
    	height:auto;
    }
    .tabs>ul{
    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

    .tabs_bottom{
    	400px;
    	height:auto;
    	border:1px solid #ededed;
    	min-height:200px;
    	position:relative;
    }
    .tabs_bottom>ul{
    	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

    .tabs_left{
    	400px;
    	height:auto;
    	border:1px solid #ededed;
    	min-height:200px;
    
    }
    .tabs_left>ul{
    	float:left;
    	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

    .tabs_right{
    	400px;
    	height:auto;
    	border:1px solid #ededed;
    	min-height:200px;
    
    }
    .tabs_right>ul{
    	float:right;
    	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;
    }
    

      效果如下

  • 相关阅读:
    python 全栈开发,Day13(迭代器,生成器)
    python 全栈开发,Day12(函数的有用信息,带参数的装饰器,多个装饰器装饰一个函数)
    python 全栈开发,Day11(函数名应用,闭包,装饰器初识,带参数以及带返回值的装饰器)
    关于1024:堆栈下溢的错误(1024. Stack Underflow Occurred)
    Quick 3.3 final 加载ccs的变化
    Quick 3.3 的代码资源加密
    quick code ide设置分辨率
    quick3.3rc1导入工程到ADT
    lua 基本语法
    as3 阻止后续侦听器
  • 原文地址:https://www.cnblogs.com/zjBoy/p/3733632.html
Copyright © 2011-2022 走看看