列表

详情


FED9. CSS选择器——标签、类、ID选择器

描述

请将html模块中字体内容是"红色"的字体颜色设置为"rgb(255, 0, 0)","绿色"设置为"rgb(0, 128, 0)","黑色"设置为"rgb(0, 0, 0)",且字体大小都为20px。

原站题解

HTML/CSS/JavaScript 解法, 执行用时: 1309ms, 内存消耗: 91856KB, 提交时间: 2022-03-24

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            div{\n                font-size:20px\n            }\n            div:nth-child(1){\n                color:rgb(255, 0, 0)\n            }\n            .green{\n                color:rgb(0, 128, 0)\n            }\n            #black{\n                color:rgb(0, 0, 0)\n            }\n        </style>\n    </head>\n    <body>\n        <div>红色</div>\n        <div class='green'>绿色</div>\n        <div id='black'>黑色</div>\n    </body>\n</html>","libs":[]}

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

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            body{\n                color:rgb(255, 0, 0);\n                font-size:20px;\n            }\n            \n            \n            .green{\n               color:rgb(0, 128, 0);\n            }\n            \n            #black{\n                color:rgb(0, 0, 0);\n            }\n                \n        </style>\n    </head>\n    <body>\n        <div>红色</div>\n        <div class='green'>绿色</div>\n        <div id='black'>黑色</div>\n    </body>\n</html>","libs":["jquery"]}

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

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            div {\n                color: rgb(255,0,0);\n                font-size: 20px;\n            }\n            .green {\n                color: rgb(0, 128, 0);\n            }\n            #black {\n                color: rgb(0, 0, 0);\n            }\n        </style>\n    </head>\n    <body>\n        <div>红色</div>\n        <div class='green'>绿色</div>\n        <div id='black'>黑色</div>\n    </body>\n</html>","libs":[]}

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

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            div{\n                font-size: 20px;\n                color: rgb(255, 0, 0);\n            }\n            .green{\n                color: rgb(0, 128, 0);\n            }\n            #black{\n                color: rgb(0, 0, 0);\n            }\n        </style>\n    </head>\n    <body>\n        <div>红色</div>\n        <div class='green'>绿色</div>\n        <div id='black'>黑色</div>\n    </body>\n</html>","libs":[]}

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

{"css":"","js":"","html":"<html>\n    <head>\n        <meta charset=utf-8>\n        <style type=\"text/css\">\n            /*补全代码*/\n            div {\n                \n                font-size: 20px;\n            }\n            .green {\n                color: rgb(0,128,0);    \n            }\n            #black {\n                color: rgb(0,0,0);\n            }\n        </style>\n    </head>\n    <body>\n        <div style=\"color: rgb(255,0,0);\">红色</div>\n        <div class='green'>绿色</div>\n        <div id='black'>黑色</div>\n    </body>\n</html>","libs":[]}

上一题