Html &引用;元素样式不允许作为元素形式的子元素;

Html &引用;元素样式不允许作为元素形式的子元素;,html,w3c-validation,Html,W3c Validation,出于某种原因,我收到一个错误,上面写着: 在此上下文中,元素style不允许作为元素form的子元素。(正在抑制来自此子树的进一步错误。) 第17行 这是我的密码: <!DOCTYPE HTML> <html lang="en-US"><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Un

出于某种原因,我收到一个错误,上面写着:

在此上下文中,元素
style
不允许作为元素
form
的子元素。(正在抑制来自此子树的进一步错误。)

第17行

这是我的密码:

    <!DOCTYPE HTML>
    <html lang="en-US"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <form method="post" spellcheck="true" action="http://www.ijdky.net">


    <input name="text" class="name" placeholder="Please Enter Name">
    <!-- This Part is Where the user will type their name for the comment section-->

    <br> <!-- Break -->
    <br> <!-- Break -->

    <style type="text/css"> textarea.html-text-box {background-color:white;background-repeat:no-repeat;background-attachment:fixed;border-width:4;border-style:solid;border-color:black;font-family:Georgia;font-size:16pt;color:black;}
input.html-text-box {background-color:ffffff;font-family:Georgia;font-size:12pt;color:000000;}
    </style> <!-- The Comment Box -->
    <textarea name="comments" cols="40" rows="10" class="html-text-box">            </textarea>

    <br> <!-- Break -->
    <br> <!-- Break -->

    <input type="submit" value="Submit Comment" class="html-text-box">

    <br> <!-- Break -->
    <br> <!-- Break -->

    <input type="reset" value="Reset Comment" class="html-text-box">

    </form>
    </body>
    </html

    <!-- begin snippet: js hide: false -->

    <!-- language: lang-html -->

    <!DOCTYPE HTML>
    <html lang="en-US"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <form method="post" spellcheck="true" action="http://www.ijdky.net">


    <input name="text" class="name" placeholder="Please Enter Name">
    <!-- This Part is Where the user will type their name for the comment section-->

    <br> <!-- Break -->
    <br> <!-- Break -->

    <style type="text/css"> textarea.html-text-box {background-color:white;background-repeat:no-repeat;background-attachment:fixed;border-width:4;border-style:solid;border-color:black;font-family:Georgia;font-size:16pt;color:black;}
    input.html-text-box {background-color:ffffff;font-family:Georgia;font-size:12pt;color:000000;}
    </style> <!-- The Comment Box -->
    <textarea name="comments" cols="40" rows="10" class="html-text-box"></textarea>

    <br> <!-- Break -->
    <br> <!-- Break -->

    <input type="submit" value="Submit Comment" class="html-text-box">

    <br> <!-- Break -->
    <br> <!-- Break -->

    <input type="reset" value="Reset Comment" class="html-text-box">

    </form>
    </body>
    </html>

无标题文件


textarea.html-text-box{背景颜色:白色;背景重复:无重复;背景附件:固定;边框宽度:4;边框样式:纯色;边框颜色:黑色;字体系列:乔治亚;字体大小:16pt;颜色:黑色;} input.html-text-box{背景颜色:ffffff;字体系列:Georgia;字体大小:12pt;颜色:000000;}



无标题文件

textarea.html-text-box{背景颜色:白色;背景重复:无重复;背景附件:固定;边框宽度:4;边框样式:纯色;边框颜色:黑色;字体系列:乔治亚;字体大小:16pt;颜色:黑色;} input.html-text-box{背景颜色:ffffff;字体系列:Georgia;字体大小:12pt;颜色:000000;}




我到处都找遍了,什么也找不到。

你做错了,把
标签放错了地方。将所有
声明放在文档的
部分。根据,这是它必须去的地方。

移动此:

textarea.html-text-box{背景颜色:白色;背景重复:无重复;背景附件:固定;边框宽度:4;边框样式:纯色;边框颜色:黑色;字体系列:格鲁吉亚;字体大小:16pt;颜色:黑色;}
input.html-text-box{背景颜色:ffffff;字体系列:Georgia;字体大小:12pt;颜色:000000;}


元素。

谢谢。这起作用了。你真的是HTML5的专家吗。如果是这样,我应该去哪里了解更多信息。我正在尝试创建一个网站,但不确定如何将css页面与HTML页面链接。@DeQuanLynch-Mozilla站点是一个很好的起点。非常感谢,这解决了我的问题。单身会让人发疯。