码迷,mamicode.com
首页 > Web开发 > 详细

纯CSS选项卡

时间:2015-05-15 15:02:35      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

html:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link href="123.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="Container">
  <div id="Header">
    <div id="Logo">55555555555555555</div>
  </div>
  <div id="Content">
    <div id="LeftContent">
      <dl>
        <dt><a href="#xw">新闻</a><a href="#YL">娱乐</a><a href="#TY">体育</a></dt>
        <dd>
          <ul id="xw">
            <li>新闻1</li>
            <li>新闻2</li>
            <li>新闻3</li>
            <li>新闻4</li>
            <li>新闻5</li>
          </ul>
          <ul id="YL">
            <li>娱乐1</li>
            <li>娱乐2</li>
            <li>娱乐3</li>
            <li>娱乐4</li>
            <li>娱乐5</li>
            <li>娱乐6</li>
          </ul>
          <ul id="TY">
            <li>体育1</li>
            <li>体育2</li>
          </ul>
        </dd>
      </dl>
    </div>
    <div id="MainContent"> 主内容 </div>
  </div>
  <div class="clear"></div>
  <div id="Footer">页脚</div>
</div>
</body>
</html>

CSS:

@charset "utf-8";
/* CSS Document */

#Container {
    width: 1000px;
    margion: 0 auto;
    height: 1000px
}
#Header {
    height: 100Px;
    background: green;
}
#Logo {
    padding-left: 50px;
    padding-bottom: 20px;
    padding-top: 10px;
}
#Content {
    margin: 5, 5, 5, 5;
    height: 600px;
}
#LeftContent {
    width: 300px;
    height: 800px;
    float: left;
    margion: 20px;
    background: red;
}
#MainContent {
    width: 700px;
    height: 800px;
    float: left;
    margion: 20px;
    background: #0C78DD;
    
}
.clear {
    clear: both;
}
#Footer {
    height: 100px;
    background: #0AF333;
}
dl {
    position: absolute;/*绝对的*/
    width: 200px;
    height: 200px;
    border: 10px solid #E9F5E9;
}
dd {
    width: 200px;
    height: 200px;
    overflow: hidden;
}
dt {
    position: absolute;
    right: 1px;
}
ul {
    margion: 0;
    padding: 0;
    width: 220px;
    height: 200px;
    list-style: none;
    border: 1px solid black
}
li {
    width: 207px;
    height: 27px;
    overflow: hidden;
}
dt a {
    display:block;
    /*margin: 1px;*/
    width: 30px;
    height: 56px;
    text-align: center;
    font: 700 12px/55px "宋体",sans-serif;
    color: #fff;
    text-decoration: none;
    background: #666;
    /*display:block;
margin:1px;
width:30px;
height:56px;
text-align:center;
font:700 12px/55px "宋体",sans-serif;
color:#fff;
text-decoration:none;
background:#666;*/
}

dt a:hover{
    background:green;}

 

纯CSS选项卡

标签:

原文地址:http://www.cnblogs.com/tangchun/p/4505805.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!