python中的html的css应用

在pycharm中为啥style样式下的内容为灰色而且应用到class中也没有反应


<head>
    <meta charset="UTF-8">
    <title>小米商城</title>
    <style>
        /* 去掉body的边距 */
        body {
            margin: 0;
        }

        .header {
            background-color: #333;
        }

        /* 让中间内容居中 */
        .container {
            width: 1226px;
            margin: 0 auto;     /* 上下为0, 左右为auto */
        }
    </style>
</head>
<body>
<div class="header">
    <div class = 'container'>


    </div>


</div>
</body>
</html>
# 试试在头部添加
<style type="text/css">

【相关推荐】




如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^