html练习题

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <!--  1.给第一个div宽高100px红色边框左上和右下角改成圆形(提示:nth-child) -->
        <style>
            body>div:first-child {
                width: 100px;
                height: 100px;
                border: 1px solid red;
                border-top-left-radius: 50%;
                border-bottom-right-radius: 50%;
            }

            body>div:nth-child(3) {
                width: 100px;
                height: 100px;
                border-top: 1px solid green;
                border-left: 1px solid green;
            }

            body>span:nth-of-type(1) {
                border: 1px solid blue;
                display: inline-block;
                width: 100px;
                height: 100px;
                font-size: 20px;
                text-align: center;
                line-height: 100px;
                text-decoration: underline;
                font-weight: bold;
            }

            .ol_first>li {
                list-style: none;
            }

            .ol_first>li::before {
                display: inline-block;
                content: "";
                border: 1px solid red;
                background-color: red;
                width: 5px;
                height: 5px;
                border-radius: 50%;
                margin-right: 10px;
            }

            .ul_first>li:nth-child(even) {
                border: 1px solid blue;
                margin: 10px;
                padding: 10px;
            }

            a:link {
                color: green;
                text-decoration: none;
            }

            a:hover {
                color: red;
                text-decoration: underline;
            }

            a:visited {
                color: black;
            }

            a:active {
                color: yellow;
            }

            .ol_second>* {
                border: 1px solid red;
            }

            .ol_second {
                position: relative;
            }

            .ol_second>div {
                position: absolute;
                bottom: 0;
            }

            body>div:nth-of-type(3) {
                width: 100px;
                height: 50px;
                border: 4px solid blue;
                line-height: 50px;
                text-align: center;
                text-shadow: 5px 5px 3px black;
                box-shadow: 5px 5px 3px brown;
            }
            p{
                
                width: 110px;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        </style>
    </head>
    <body>
        <div></div>
        <span>哈哈哈哈</span>
        <div></div>
        <span></span>
        <ol class="ol_first">
            <li id="item1">子项1</li>
            <li id="item2">子项2</li>
            <li id="item3">子项3
                <ul class="ul_first">
                    <li id="item21">子项21</li>
                    <li id="item22">子项22</li>
                    <li id="item23">子项23</li>
                </ul>
            </li>
        </ol>
        <ol class="ol_second">
            <li>子项31</li>
            <li>子项32</li>
            <div>div33</div>
            <a href="#">这是一个a链接</a>
        </ol>
        <div>button</div>
        <p>
            wdguahdiajidhiwsjwhdwefaf
        </p>
    </body>
</html>

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值