简体   繁体   English

如何解决 body 属性以在 CSS 中为 Codepen 显示颜色?

[英]How can I solve the body property to display color in CSS for Codepen?

I'm trying to add color in the body property of my CSS in Codepen.我正在尝试在 Codepen 的 CSS 的 body 属性中添加颜色。 Have not added anything but the title to the webpage, but it does not changes color regardless of where I put the tag.除了网页的标题外,没有添加任何内容,但无论我将标签放在哪里,它都不会改变颜色。 Tried to place the <body> html tag before <head> , erased <main> , still no change.尝试将<body> html 标签放在<head>之前,删除<main> ,仍然没有变化。

<!DOCTYPE html>
<html>

    <head>
        <title>Project Survey Form</title>
    </head>
    <body id="body">    
        <main>
            <h1 id="title">Survey Form</h1>

        </main>
    </body>
</html>

<style>

body {
    background-color: blue;
}

</style>

It keeps displaying the white background.它一直显示白色背景。 Do you know of any workaround for this?你知道有什么解决方法吗?

Codepen at CSS section , you don't need style tag Codepen 在CSS 部分,你不需要样式标签

<style>

body {
    background-color: blue;
}

</style>

to

   body {
        background-color: blue;
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我怎样才能放入全身背景色CSS - how can i put in all body background color css 如何使我的网页显示与在Codepen上显示的方式相同? - How can I get my webpage to display the same way it displays on Codepen? 使用 CodePen - 如何将我的 CSS 添加到 HTML for Wix? - Using CodePen- How can I add my CSS to HTML for Wix? 如何在 css 的帮助下只为 div 而不是全身赋予靛蓝色? - How i can give a indigo color only to a div instead of whole body with help of css? 如何解决在 Chrome 和 Brave 的检查元素中复制/粘贴 CSS 属性和值的问题? - How can I solve the problem of copy/pasting the CSS property and value in inspect element both Chrome and Brave? 尽管我们使用显示 css 属性,但如何使用 [hidden] 属性隐藏 DOM 元素? - How can I hide DOM element using [hidden] property although we use display css property? 如何在 css `content` 属性中/顶部放置链接(不会弄乱属性的显示)? - How can I place a link in/on top of a css `content` property (without messing up the display of the property)? 当身体模糊时,如何在身体上显示元素? - How can i display element over body, when body is blured? css 强制颜色调整属性在应用内的 facebook 浏览器中不起作用,如何解决? - css forced-color-adjust property don't work in facebook browser in-app, how solve? 如何解决.png 背景颜色问题? - How can I solve .png background-color problem?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM