CSS常用操作

index01.html
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
    <div class="div"></div>
    <p class="p1">CSS操作之设置行高,这个是正常行高</p>
    <br/>
    <p class="p2">CSS操作之设置行高,这个是拉伸行高</p>
    <br/>
    <p class="p3">CSS操作之设置行高,这个是压缩行高</p>
    <br/>
    <p>Hello world!</p>
<br/>
   <div> <ul>
        <li><a href="http://www.w3school.com.cn/">W3C</a></li>
        <li><a href="http://www.jikexueyuan.com/">极客学院</a></li>
        <li><a href="http://www.runoob.com/">菜鸟联盟</a></li>
    </ul>
    <br/></div>
    <div class="content"><div class="image">
        <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
            <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
        </a>
        <div class="text" >变形金刚大黄蜂</div>
    </div>
        <div class="image">
            <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
                <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
            </a>
            <div class="text" >变形金刚大黄蜂</div>
        </div>
        <div class="image">
            <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
                <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
            </a>
            <div class="text" >变形金刚大黄蜂</div>
        </div>
        <div class="image">
            <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
                <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
            </a>
            <div class="text" >变形金刚大黄蜂</div>
        </div>
        <div class="image">
            <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
                <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
            </a>
            <div class="text" >变形金刚大黄蜂</div>
        </div>
        <div class="image">
            <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
                <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
            </a>
            <div class="text" >变形金刚大黄蜂</div>
        </div><div class="image">
            <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
                <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
            </a>
            <div class="text" >变形金刚大黄蜂</div>
        </div><div class="image">
            <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
                <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
            </a>
            <div class="text" >变形金刚大黄蜂</div>
        </div><div class="image">
            <a href="https://baike.so.com/doc/5390870-7595057.html" target="_blank">
                <img src="1.jpg" alt="大黄蜂" width="300px" height="300px">
            </a>
            <div class="text" >变形金刚大黄蜂</div>
        </div></div>
</body>
</html>

style.css
*{
    margin: 0px;
}
.div{
    width: 70%;
    height: 500px;
    background-color: red;
    margin: 20px auto;
}
.p1{
    width: 150px;
    line-height: normal;
}
.p2{
    width: 150px;
    line-height: 300%;
}
.p3{
    width: 150px;
    line-height: 50%;
}

p{
    cursor:all-scroll;
}
ul{
    list-style-type: none;
    margin: 20px;
    padding: 20px;
    line-height: 40px;
}
/*垂直导航栏*/
/*a:link,a:visited{*/
    /*text-decoration: none;*/
    /*display: block;*/
    /*background-color: bisque;*/
    /*color: aqua;*/
    /*width: 100px;*/
    /*text-align: center;*/
/*}*/
/*a:hover,a:active{*/
    /*background-color: chartreuse;*/
/*}*/


/*水平导航栏*/
ul{
    list-style-type: none;
    margin: 20px;
    padding: 20px;
    background-color: sandybrown;
    width: 250px;
    height:30px;
    text-align: center;
}
a:link,a:visited{
    text-decoration: none;
    font-weight: bold;
    background-color: aquamarine;
    color: brown;
    width: 100px;
    text-align: center;
}
a:active,a:hover{
    background-color: darkslateblue;
}
li{
    line-height: 30px;
    display: inline;
    padding: 5px;
    padding-left: 8px;
    padding-right: 8px;
}

body{
    margin: 10px auto;
    width: 70%;
    height: auto;
    background-color: bisque;
}
.image{
    border: 1px solid red;
    width: auto;
    height: auto;
    float: left;
    text-align: center;
    margin: 5px;
}
img{
    margin: 5px;
    opacity: 1;
}
.text{
    font-size: 20px;
    margin-bottom: 5px;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值