简体   繁体   English

如何修复以下错误:错误:在此上下文中,元素样式不允许作为元素标题的子元素

[英]How to fix the following error : Error: Element style not allowed as child of element header in this context

I am trying to validate this using an online html validator, every time I run it It gets me an error : 每当我运行它时,我都试图使用在线html验证程序来验证它,这会给我一个错误:

: Element style not allowed as child of element header in this context :在此上下文中,元素样式不允许作为元素标题的子元素

I do not how to fix, i am hopping you guys can help me out. 我不怎么解决,我希望你们能帮助我。

I am trying to validate this using an online html validator, every time I run it It gets me an error : 每当我运行它时,我都试图使用在线html验证程序来验证它,这会给我一个错误:

: Element style not allowed as child of element header in this context :在此上下文中,元素样式不允许作为元素标题的子元素

I do not how to fix, i am hopping you guys can help me out. 我不怎么解决,我希望你们能帮助我。

thanks 谢谢

<html lang="en">
    <head>
    <link rel="stylesheet" type="text/css" href="csspage.css"/>
        <title>My Home Page</title>

    </head>

    <body>
        <section>
            <header>


                <h1>Welcome!!</h1>

                <style type="text/css">
                    header{
                        position:fixed;
                        textsize:80;
                        }

                    </style>

            </header>


            <nav>
                <a href="#">Home</a> |
                <a href="#">First Page</a> |
                <a href="#">Second Page</a> |
                <a href="#">Third Page</a>
            </nav>



            <article>
                <h2 id="idh2">Short Bio (ID element)</h2>
                <img class ="pic1" src="http://me.byu.edu/sites/default/files/byu_logo.gif" style=float:right alt= "test" />

                <p>I go to BYU. I was a 210 student and I can't seem to think of what to write here. Here is random text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
                <p>Have you ever seen a movie where the main characters are fantastic creatures? Have you ever read a book where there is a powerful warrior whom nobody can defeat but is unlucky in love? It is very likely that you have been exposed to these wonderful tales and enjoyed the stories. Furthermore, believe it or not, most of those stories are based on ancient myth which at the beginning were presented in an oral-poetic tradition and then written in texts. It is in Greek mythology where a rich number of stories of gods and goddess, heroes and kings, and the creation of nature are found. Who has not heard about Achilles in the epic Iliad or the adventures Odysseus in the Odyssey written by Homer or the amazing accomplishments achieved by the courageous Heracles. However, not all the myths are based on war and tragedy. There is also love, the most wonderful feeling of all. One of the most beautiful and tragic stories in Greek mythology is the account of Orpheus and Eurydice found in Ovid’s Metamorphoses.</P>
                <p>Orpheus was the son of Apollo. The god Apollo taught Orpheus to play the lyre. He learned it to play it so well that even the god was impressed. Nobody could resist the sound and melody of Orpheus’ lyre. Orpheus fell in love with Eurydice, a woman of unique beauty and grace. They sealed their love in marriage, but it was not meant to last for long. One day, as Eurydice was wandering in the forest with a crowd of naiads, she was beaten by a snake and died. Orpheus became so sad that he dared to go down to Tartarus to talk with the lord of underground, Hades and his wife Persephone. As usual, Orpheus played beautiful melodies on his lyre that not only were pleasant to the god but also to all the creatures around. Accompanied by his wife Persephone, Orpheus sang, “My wife is the cause of my journey. A viper she trod on diffused its venom into her body, and robbed her of her best years … I beg you, by these fearful places, by this immense abyss, and the silence of your vast realms, reverse Eurydice’s swift death.” (Ovid, Metamorphoses) The king of the dead and his royal bride could not refuse the prayer given by Orpheus and called Eurydice. Hades accepted the petition but there was one condition that the lovers had to follow. As Orpheus and Eurydice leave Tartarus, He must not look back at her lover. As they were walking upward through a mist of darkness and silence, Orpheus became afraid that Eurydice was no longer there. As soon as Orpheus looked back, Eurydice disappeared and he only saw receding air. Orpheus then became extremely sad for losing his wife for the second time. Orpheus could not bring his wife Eurydice back to his world. This lovely but also tragic story shows what person is willing to do for his lover. Nevertheless, as we will see in the next paragraphs, the myth of Orpheus and Eurydice might not disappear through time since it continually influences art in many ways such as painting, films, and music.</p> 
                <p>The lovely and tragic story of Orpheus and Eurydice has inspired many artists in visual arts especially in painting where a vast number of paintings has been created base on the myth. One of the most notably visual arts created was painted by the famous Flemish artist Peter Paul Rubens named “Orpheus and Eurydice”. In this painting, Rubens is portraying one of the most important scenes of the myth. It refers when Orpheus is meeting with Hades and queen Persephone on quest to bring Eurydice back to his world. Because of the talent, Orpheus has with the lyre, Hades has granted Orpheus’ request. However, the condition was that Orpheus should not look at his wife. Rubens, in an effort to show more than one scene of the myth in just one setting, illustrates Orpheus having his doubts about the promise given by Hades. It shows Orpheus with a lack of faith feeling temped to look behind to see if his wife was there. The artist is trying to show us that it is better to have faith and obey what god has commanded. Otherwise, our desires will not be granted. Rubens use iconography to easily identify hades such as his scepter and the three-headed dog called Cerberus. It is worth to mention that while Orpheus was playing the lyre, the dangerous and aggressive creature was very calm.</p>

            </article>

            <h2 class="color">This is a class element</h2>
            <div class="circle">Transition</div>
            <img class="pic" src="http://news.byu.edu/sites/default/files/1708-50%2001.jpg" alt="claudio"/>
            <img class="picenlargement" src="http://news.byu.edu/sites/default/files/1708-50%2001.jpg" alt="claudio"/>
            <footer>
                <p>
                    Copyright © 2010 by Bill Shakespeare
                </p>
            </footer>
        </section>
    </body>
</html>


  
 
  
  
  
    <!DOCTYPE HTML>



    <html lang="en">
    	<head>
    	<link rel="stylesheet" type="text/css" href="csspage.css"/>
    		<title>My Home Page</title>

    	</head>
    	
    	<body>
    		<section>
    			<header>
    			
    			
    				<h1>Welcome!!</h1>
    					
    				<style type="text/css">
    					header{
    						position:fixed;
    						textsize:80;
    						}
    				
    					</style>
    	
    			</header>
    			
    			
    			<nav>
    				<a href="#">Home</a> |
    				<a href="#">First Page</a> |
    				<a href="#">Second Page</a> |
    				<a href="#">Third Page</a>
    			</nav>

    	
    				
    			<article>
    				<h2 id="idh2">Short Bio (ID element)</h2>
    				<img class ="pic1" src="http://me.byu.edu/sites/default/files/byu_logo.gif" style=float:right alt= "test" />
    				
    				<p>I go to BYU. I was a 210 student and I can't seem to think of what to write here. Here is random text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
    				<p>Have you ever seen a movie where the main characters are fantastic creatures? Have you ever read a book where there is a powerful warrior whom nobody can defeat but is unlucky in love? It is very likely that you have been exposed to these wonderful tales and enjoyed the stories. Furthermore, believe it or not, most of those stories are based on ancient myth which at the beginning were presented in an oral-poetic tradition and then written in texts. It is in Greek mythology where a rich number of stories of gods and goddess, heroes and kings, and the creation of nature are found. Who has not heard about Achilles in the epic Iliad or the adventures Odysseus in the Odyssey written by Homer or the amazing accomplishments achieved by the courageous Heracles. However, not all the myths are based on war and tragedy. There is also love, the most wonderful feeling of all. One of the most beautiful and tragic stories in Greek mythology is the account of Orpheus and Eurydice found in Ovid’s Metamorphoses.</P>
    				<p>Orpheus was the son of Apollo. The god Apollo taught Orpheus to play the lyre. He learned it to play it so well that even the god was impressed. Nobody could resist the sound and melody of Orpheus’ lyre. Orpheus fell in love with Eurydice, a woman of unique beauty and grace. They sealed their love in marriage, but it was not meant to last for long. One day, as Eurydice was wandering in the forest with a crowd of naiads, she was beaten by a snake and died. Orpheus became so sad that he dared to go down to Tartarus to talk with the lord of underground, Hades and his wife Persephone. As usual, Orpheus played beautiful melodies on his lyre that not only were pleasant to the god but also to all the creatures around. Accompanied by his wife Persephone, Orpheus sang, “My wife is the cause of my journey. A viper she trod on diffused its venom into her body, and robbed her of her best years … I beg you, by these fearful places, by this immense abyss, and the silence of your vast realms, reverse Eurydice’s swift death.” (Ovid, Metamorphoses) The king of the dead and his royal bride could not refuse the prayer given by Orpheus and called Eurydice. Hades accepted the petition but there was one condition that the lovers had to follow. As Orpheus and Eurydice leave Tartarus, He must not look back at her lover. As they were walking upward through a mist of darkness and silence, Orpheus became afraid that Eurydice was no longer there. As soon as Orpheus looked back, Eurydice disappeared and he only saw receding air. Orpheus then became extremely sad for losing his wife for the second time. Orpheus could not bring his wife Eurydice back to his world. This lovely but also tragic story shows what person is willing to do for his lover. Nevertheless, as we will see in the next paragraphs, the myth of Orpheus and Eurydice might not disappear through time since it continually influences art in many ways such as painting, films, and music.</p> 
    				<p>The lovely and tragic story of Orpheus and Eurydice has inspired many artists in visual arts especially in painting where a vast number of paintings has been created base on the myth. One of the most notably visual arts created was painted by the famous Flemish artist Peter Paul Rubens named “Orpheus and Eurydice”. In this painting, Rubens is portraying one of the most important scenes of the myth. It refers when Orpheus is meeting with Hades and queen Persephone on quest to bring Eurydice back to his world. Because of the talent, Orpheus has with the lyre, Hades has granted Orpheus’ request. However, the condition was that Orpheus should not look at his wife. Rubens, in an effort to show more than one scene of the myth in just one setting, illustrates Orpheus having his doubts about the promise given by Hades. It shows Orpheus with a lack of faith feeling temped to look behind to see if his wife was there. The artist is trying to show us that it is better to have faith and obey what god has commanded. Otherwise, our desires will not be granted. Rubens use iconography to easily identify hades such as his scepter and the three-headed dog called Cerberus. It is worth to mention that while Orpheus was playing the lyre, the dangerous and aggressive creature was very calm.</p>
     
    			</article>
    			
    			<h2 class="color">This is a class element</h2>
    			<div class="circle">Transition</div>
    			<img class="pic" src="http://news.byu.edu/sites/default/files/1708-50%2001.jpg" alt="claudio"/>
    			<img class="picenlargement" src="http://news.byu.edu/sites/default/files/1708-50%2001.jpg" alt="claudio"/>
    			<footer>
    				<p>
    					Copyright © 2010 by Bill Shakespeare
    				</p>
    			</footer>
    		</section>
    	</body>
    </html>

tags can only appear in the tag. 标签只能出现在标签中。 So trying moving your style gats to the head. 因此,请尝试将样式门移到头部。

<link rel="stylesheet" type="text/css" href="csspage.css"/>
    <title>My Home Page</title>
    <style type="text/css">
        header{
               position:fixed;
               textsize:80;
              }

    </style>
</head>

暂无
暂无

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

相关问题 在这种情况下,不允许将元素样式作为元素主体的子元素 - Element style not allowed as child of element body in this context 元素<a>不能作为元素的子元素</a> <dl> <a>在这种情况下-验证程序错误</a> - Element <a> not allowed as child of element <dl> in this context - Validator Error 了解错误“在这种情况下,不允许将图例用作元素div的子级。” - Understanding the error “Element legend not allowed as child of element div in this context.” HTML 验证器错误 - 在此上下文中不允许元素滑块作为元素主体的子元素 - HTML Validator Error - Element slider not allowed as child of element body in this context 在此上下文中不允许元素样式作为元素主体的子元素( <style scoped> not validating) - Element style not allowed as child of element body in this context (<style scoped> not validating) HTML 5-如何解决验证错误?-在这种情况下,元素div不能作为元素h1的子元素 - HTML 5- How to get around a validation error?- Element div not allowed as child of element h1 in this context HTML5 验证错误:在此上下文中不允许元素源作为音频的子元素 - HTML5 validation error: Element source not allowed as a child element of audio in this context 验证错误:在此上下文中,元素 hr 不允许作为元素 ul 的子元素。 (抑制来自该子树的更多错误。) - Validation Error: Element hr not allowed as child of element ul in this context. (Suppressing further errors from this subtree.) 错误:在这种情况下,元素tbody不能作为元素表的子元素。 (抑制此子树中的其他错误。) - Error: Element tbody not allowed as child of element table in this context. (Suppressing further errors from this subtree.) 验证错误:元素a在此上下文中不允许作为元素ul的子元素。 (抑制此子树中的更多错误。) - Validation Error: Element a not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM