题解 | #添加元素#

定位 - z-index

http://www.nowcoder.com/practice/9654df407115464c8865c8c77a3a728e

{"css":"","js":"","html":"<!DOCTYPE html>\n<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            * {\n                margin: 0;\n                padding: 0;\n            }\n            img{\n                position:absolute;\n                left: 0;\n                top:0;\n                z-index: -1;\n            }\n        </style>\n    </head>\n    <body>\n    \t<h1>The countdown to Christmas starts here.</h1>\n        <img src=\"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fuploads.xuexila.com%2Fallimg%2F1912%2F1135-191202143454.jpg&refer=http%3A%2F%2Fuploads.xuexila.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1639984107&t=eca951193e736a17eb96278117bcfb1f\" width=\"100\">\n        <p>由于图像的 z-index 是 -1,因此它在文本的后面出现。</p>\n    </body>\n</html>","libs":[]}
全部评论

相关推荐

哈哈哈哈哈哈哈哈哈哈这个世界太美好了
凉风落木楚山秋:毕业出路老师不管,你盖个章他好交差就完事了,等你盖完毕业了就不关他事情了
点赞 评论 收藏
分享
码农索隆:有点耳熟,你们是我教过最差的一届
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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