HTML第六天

1

    <!DOCTYPE html>
    <html>
<head>
    <title>按钮练习</title>
    <meta charset="utf-8" />
    <style type="text/css">
        .cc{
            display: block;
            width: 161px;
            height: 44px;
            background-image: url(amazon-sprite_.png)
            /*background-repeat: no-repeat;*/
        }
        .cc:active{
            display: block;
            width: 43px;
            height: 31px;
            background-image: url(amazon-sprite_.png);
            /*background-repeat: no-repeat;*/
            background-position: -58px -338px;
        }
        /*.cc:active{
            background-image: url(timg3.jpg);
            background-position: -400px 0px;
        }*/
        
    </style>
</head>
<body>
    <a href="#" class="cc"></a>
</body>
    </html>

2

    <!DOCTYPE html>
    <html>
<head>
    <title>背景</title>
    <meta charset="utf-8" />
    <style type="text/css">
        .box1{
            width: 1920px;
            height: 1200px;
            margin: 0 auto;
            background-color: #bfa;
            /*background-image: url(timg3.jpg)*/
        }
    </style>
</head>
<body>
    <div class="box1"></div>
</body>
    </html>

3

    <!DOCTYPE html>
    <html>
<head>
    <title>简写属性背景</title>
    <meta charset="utf-8" />
    <style type="text/css">
        body{
            height: 5000px;
            /*background-color: #bfa;
            background-repeat: no-repeat;
            background-image: url(timg3.jpg);
            background-position: center;
            background-attachment: fixed;*/
            background-color: #bfa;
            background: url(timg3.jpg) center center
                no-repeat fixed;
            
        }
    </style>
</head>
<body>
    
</body>
    </htmml>

4

    <!DOCTYPE html>
    <html>
<head>
    <title>表格</title>
    <meta charset="utf-8" />
    <style type="text/css">
        
    </style>
</head>
<body>
    <table border="1" width="50%" align="center">
        <tr>
            <td rowspan="2">A1</td>
            <td>A2</td>
            <td>A3</td>
        </tr>
        <tr>
            
            <td colspan="2">A2</td>
            
        </tr>

    </table>
</body>
    </htmml>

5

    <!DOCTYPE html>
    <html>
<head>
    <title>给表格添加样式</title>
    <meta charset="utf-8" />
        <style type="text/css">
            table{
                width: 694px;
                height: 50px;
                margin: 0 auto;
                border-collapse: collapse;
        }
            td{
                border: 1px solid gold; 
                text-align-last: center; 
        }
            td:hover{
                background-color: orange;
        }
            a{
                font-size: 16px;
                font-family: "微软雅黑";
                color: pink;
                text-decoration: none;
        }
            a:hover{
                color: red;
        }
        </style>
</head>
<body>
    <table>
        <tr>
            <td><a href="#">首页</a></td>         
            <td><a href="#">公司简介</a></td>
            <td><a href="#">解决方案</a></td>
            <td><a href="#">公司新闻</a></td>
            <td><a href="#">行业动态</a></td>
            <td><a href="#">招贤纳才</a></td>
            <td><a href="#">联系我们</a></td>
        </tr>

    </table>
</body>
    </html>

6

    <!DOCTYPE html>
    <html>
<head>
    <title>导航标</title>
    <meta charset="utf-8" />
    <style type="text/css">
        table{
            width: 960px;
            height: 42px;
            margin: 0 auto;
            border: 1px solid gold;
        }
        a{
            font-family: "微软雅黑";
            font-size: 12px;
            padding: 5px 10px;
            border: 1px solid gold;
            background-color: gold;
            text-decoration: none;
            margin-right: 1px;
        }
        td{
            overflow: hidden;
            text-align: 30px;
            padding-top: 5px;
            text-align-last: center;
        }
        a:hover{
            background-color: red;
        }
        tr{
            padding-left: 300px;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <table>
        <tr>
            <td><a href="#">上一页</a></td>
            <td><a href="#">1</a></td>
            <td><a href="#">2</a></td>
            <td>...</td>
            <td><a href="#">3</a></td>
            <td><a href="#">4</a></td>
            <td><a href="#">下一页</a></td>
        </tr>
    </table>
</body>
    </htmml>

7

    <!DOCTYPE html>
    <html>
<head>
    <title>固定定位</title>
    <meta charset="utf-8" />
    <style type="text/css">
        .box1{
            width: 200px;
            height: 200px;
            background-color: red;
            position: relative;
            opacity: 0.5;
            filter: alpha(opacity=50)
        }
        .box2{
            width: 200px;
            height: 200px;
            background-color: blue;
            position: absolute;
            top: 100px;
            left: 100px;
            opacity: 0.5
        }
        .box3{
            width: 200px;
            height: 200px;
            background-color: green;
            position: absolute;
            left: 200px;
            top: 200px; 
            opacity: 0.5;
        }
        /*.box4{
            width: 200px;
            height: 200px;
            background-color: yellow;
            position: relative;
        }
        .box5{
            width: 100px;
            height: 100px;
            background-color: orange;
            position: absolute;
        }*/
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
    <!-- <div class="box4">
        <div class="box5"></div>
    </div> -->
</body>
    </html>

8

    <!DOCTYPE html>
    <html>
<head>
    <title>给表格添加样式</title>
    <meta charset="utf-8" />
    <style type="text/css">
        table{
            width: 300px;
            margin: 0px auto;
            /*border: 1px solid black;
            border-bottom: 10px;*/
            border-collapse: collapse;
        }
        th,td{
            border: 1px solid black;
        }
        /*tr:nth-child(odd){
            background-color: #bfa
        }*/
        tr:nth-child(even){
            background-color: #bfa
        }
        tr:hover{
            background-color: blue;
        }
    </style>
</head>
<body>
    <table>
        <tr>
            <th>学号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>住址</th>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>花果山</td>
        </tr>
        <tr>
            <td>2</td>
            <td>猪八戒</td>
            <td>男</td>
            <td>高老庄</td>
        </tr>
        <tr>
            <td>2</td>
            <td>猪八戒</td>
            <td>男</td>
            <td>高老庄</td>
        </tr>
        <tr>
            <td>2</td>
            <td>猪八戒</td>
            <td>男</td>
            <td>高老庄</td>
        </tr>
    </table>
</body>
    </html>

9

    <!DOCTYPE html>
    <html>
<head>
    <title>固定定位</title>
    <meta charset="utf-8" />
    <style type="text/css">
        .box1{
            width: 200px;
            height: 200px;
            background-color: red;
        }
        .box2{
            width: 200px;
            height: 200px;
            background-color: blue;
        }
        .box3{
            width: 200px;
            height: 200px;
            background-color: green;
        }
        .box4{
            width: 100px;
            height: 100px;
            background-color: gold;
            position: fixed;
            left: 10px;
            top: 10px;
        }
    </style>
</head>
<body>
    <div style="">
    <div class="box1">
        <div class="box4"></div>
    </div>
    <div class="box2"></div>
    <div class="box3"></div>
</body>
    </html>

10

    <!DOCTYPE html>
    <html>
<head>
    <title>作业</title>
    <meta charset="utf-8" />
    <style type="text/css">
        div{
            width: 400px;
            border-top: solid 2px red;
            border-bottom: solid 4px gray;
            padding: 10px 10px;
        }
        
    </style>
</head>
<body>
    <div>新闻标题</div>
</body>
    </html>

11

    <!DOCTYPE html>
    <html>
<head>
    <title>雪碧图作业</title>
    <meta charset="utf-8" />
    <style type="text/css">
        .cc{
            display: block;
            width: 100px;
            height: 100px;
        }
        .cc:active{
            display: block;
            width: 100px;
            height: 100px;
            background-image: url(bg07.jpg);
            background-position: -110px -150px;
        }


    </style>
</head>
<body>
    <a href="#" class="cc"></a>
</body>
    </html>
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 【1】7,9,-1,5,( ) A、4;B、2;C、-1;D、-3 分析:选D,7+9=16;9+(-1)=8;(...
    Alex_bingo阅读 19,916评论 1 19
  • 曾经有一份美好的爱情放在我的面前我没有珍惜。等到失去后才后悔莫及。如果可以再对小李说。毛欣想说。这辈子无缘再牵手。...
    毛欣与小李阅读 3,409评论 0 13
  • @font-face{ font-family:"Times New Roman"; } @font-face{ ...
    niki阅读 591评论 0 1
  • 现在,此刻的心情,特别好! 中午见了一位老友,我们结识在一位培训老师的微信群内,那里汇聚了全国各企业的培训工作者。...
    云海9669阅读 307评论 0 0
  • 每天都是重复着昨天,从来没有想过,对的是不是真的对的,错的是不是真的就错了,书里说的是不是真的,别人的看法...
    色即是猫阅读 286评论 0 0

友情链接更多精彩内容