列表

详情


FED11. CSS选择器——伪元素

描述

请给html模块的div元素加一个后伪元素,且后伪元素的宽度和高度都是20px,背景颜色为"rgb(255, 0, 0)"。

原站题解

HTML/CSS/JavaScript 解法, 执行用时: 1681ms, 内存消耗: 77860KB, 提交时间: 2022-02-08

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            div::after{\n                content: \"\";\n                width: 20px;\n                height: 20px;\n                background-color: rgb(255,0,0);\n                display: block;\n            }\n        </style>\n    </head>\n    <body>\n        <div></div>\n    </body>\n</html>","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 1686ms, 内存消耗: 77796KB, 提交时间: 2022-02-09

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            div{\n                position:relative;\n            }\n            div::after{\n                content:'';\n                position:absolute;\n                display:'block';\n                width:20px;\n                height:20px;\n                background:rgb(255,0,0)\n            }\n        </style>\n    </head>\n    <body>\n        <div></div>\n    </body>\n</html>","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 1686ms, 内存消耗: 77884KB, 提交时间: 2022-02-07

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            div:after{\n                content: '';\n                display: block;\n                height:20px;\n                width:20px;\n                background-color:rgb(255,0,0);\n            }\n        </style>\n    </head>\n    <body>\n        <div></div>\n    </body>\n</html>","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 1689ms, 内存消耗: 77916KB, 提交时间: 2022-02-07

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n                   div::after{\n                display:block;\n                content:'';\n                width:20px;\n                height:20px;\n                background:rgb(255,0,0)\n            \n        </style>\n    </head>\n    <body>\n        <div></div>\n    </body>\n</html>","libs":[]}

HTML/CSS/JavaScript 解法, 执行用时: 1693ms, 内存消耗: 77892KB, 提交时间: 2022-02-08

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            div::after{\n                content:\" \";\n                width:20px;\n                height:20px;\n                background-color:rgb(255, 0, 0);\n                display:block;\n            }\n        </style>\n    </head>\n    <body>\n        <div></div>\n    </body>\n</html>","libs":[]}

上一题