题解 | #定位 - inherit#

定位 - inherit

http://www.nowcoder.com/practice/333f5f366dea48f59d519565897e211a

认真读一下题目可以慢慢获取到信息,它说“虽然类名为‘inner’的盒子里设置了“left: 10px”属性,所以呢,先给inner设置一个left: 10px;的属性,在慢慢根据题目要求完成就OKK啦

<html>
    <head>
        <meta charset=utf-8>
        <style type="text/css">
            * {
                margin: 0;
                padding: 0;
            }
            .outer {
                width: 100px;
                height: 100px;
                background-color: black;
                position: relative;
            }
            .inner {
                width: 80px;
                height: 80px;
                left: 10px;
                background-color: red;
                position: inherit;
            }
        </style>
    </head>
    <body>
    	<section class="outer">
            <section class="inner">
                
            </section>
        </section>
    </body>
</html>
全部评论

相关推荐

2025-12-13 14:51
已编辑
井冈山大学 算法工程师
龙虾x:算法比你强的没有你美,比你美的…..算了已经没有比你美的了
工作两年想退休了
点赞 评论 收藏
分享
01-15 19:59
中山大学 C++
牛客60887332...:你这是人写出来的? 本科标到硕士后面 留那么多空给 hr 填?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务