luke214 Posted October 23, 2016 Share Posted October 23, 2016 Here's my code! It's telling me to add a h1-h6 heading to my section, however i already have that included in the article which is nested inside. I'll start a line before where to error is <header> <h1><ins>Welcome!</ins></h1> <p> Welcome to my website about Minerals and Rocks!<br> Hopefully you'll find some useful information to help you! </p> </header> <main id="content"> <section> <article> <h2>What a Mineral is</h2> <p> A mineral is a naturally occurring chemical compound. Most often, they are crystalline and abiogenic in origin.<br> A mineral is different from a rock, which can be an aggregate of minerals or non-minerals and does not have one<br> specific chemical composition, as a mineral does. The exact definition of a mineral is under debate, especially <br> with respect to the requirement that a valid species be abiogenic, and to a lesser extent with regard to it<br> having an ordered atomic structure. More information can be found <a href="https://en.wikipedia.org/wiki/Mineral">here</a>! </p> </article> </section> </div> <div id="wrappertwo"> <p> To the right is a short video showing different types of Geodes.<br> Take a look to see the different types you can find, or hopefully<br> buy! </p> </div> <video id="Geodevideo" controls="controls" poster="picofrock.png"> <source src="Geodes.mp4" type="video/mp4"> Your browser does not support the video tag. </video> <img class="geode" src="Geode.png" alt="Geode" /> </main> </body> </html> Here's the error i'm getting. Any help? Warning: Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections. From line 36, column 1; to line 36, column 9 ontent">↩↩<section>↩↩<art Error: End tag div seen, but there were open elements. From line 55, column 1; to line 55, column 6 section>↩↩</div>↩↩<div Error: Unclosed element main. From line 34, column 1; to line 34, column 19 /header>↩↩<main id="content">↩↩<sec Error: Stray end tag main. From line 72, column 1; to line 72, column 7 eode" />↩↩</main>↩↩</ Link to comment Share on other sites More sharing options...
dsonesuk Posted October 23, 2016 Share Posted October 23, 2016 So you are saying the error is wrong? Did you check to see why it would ask for a header tag, or just come to conclusion it wrong and that is that? Didn't think of just giving what it asked for by adding a header such as <header> <h1><ins>Welcome!</ins></h1> <p> Welcome to my website about Minerals and Rocks!<br> Hopefully you'll find some useful information to help you! </p> </header> <main id="content"> <section> <h1>Minerals</h1> <article> <h2>What a Mineral is</h2> <p> A mineral is a naturally occurring chemical compound. Most often, they are crystalline and abiogenic in origin.<br> A mineral is different from a rock, which can be an aggregate of minerals or non-minerals and does not have one<br> specific chemical composition, as a mineral does. The exact definition of a mineral is under debate, especially <br> with respect to the requirement that a valid species be abiogenic, and to a lesser extent with regard to it<br> having an ordered atomic structure. More information can be found <a href="https://en.wikipedia.org/wiki/Mineral">here</a>! </p> </article> </section> <!--</div>--> <div id="wrappertwo"> <p> To the right is a short video showing different types of Geodes.<br> Take a look to see the different types you can find, or hopefully<br> buy! </p> </div> <video id="Geodevideo" controls="controls" poster="picofrock.png"> <source src="Geodes.mp4" type="video/mp4"> Your browser does not support the video tag. </video> <img class="geode" src="Geode.png" alt="Geode" /> </main> Problem solved! Link to comment Share on other sites More sharing options...
luke214 Posted October 23, 2016 Author Share Posted October 23, 2016 (edited) So you are saying the error is wrong? Did you check to see why it would ask for a header tag, or just come to conclusion it wrong and that is that? Didn't think of just giving what it asked for by adding a header such as <header> <h1><ins>Welcome!</ins></h1> <p> Welcome to my website about Minerals and Rocks!<br> Hopefully you'll find some useful information to help you! </p> </header> <main id="content"> <section> <h1>Minerals</h1> <article> <h2>What a Mineral is</h2> <p> A mineral is a naturally occurring chemical compound. Most often, they are crystalline and abiogenic in origin.<br> A mineral is different from a rock, which can be an aggregate of minerals or non-minerals and does not have one<br> specific chemical composition, as a mineral does. The exact definition of a mineral is under debate, especially <br> with respect to the requirement that a valid species be abiogenic, and to a lesser extent with regard to it<br> having an ordered atomic structure. More information can be found <a href="https://en.wikipedia.org/wiki/Mineral">here</a>! </p> </article> </section> <!--</div>--> <div id="wrappertwo"> <p> To the right is a short video showing different types of Geodes.<br> Take a look to see the different types you can find, or hopefully<br> buy! </p> </div> <video id="Geodevideo" controls="controls" poster="picofrock.png"> <source src="Geodes.mp4" type="video/mp4"> Your browser does not support the video tag. </video> <img class="geode" src="Geode.png" alt="Geode" /> </main> Problem solved! Well no, I didn't think the error was wrong, that's why i posed it here so someone could help figure out what i messed up. Still getting a few errors even when removing the section tag and just leaving the article in. Also, what's the difference between article and section? I've read page upon page of explanations but none actually give a clear answer. Thanks! <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"/> <meta name="description" content="My website about Minerals and Rocks"/> <meta name="keywords" content="minerals,rocks,earth,gems"/> <meta name="robots" content="index,follow/"> <link rel="stylesheet" type="text/css" href="styles.css"/> <link rel="icon" href="geode.ico"/> <title>Information about Minerals and Rocks</title> </head> <body> <div id="wrapper"> <noscript>Please enable Javascript</noscript> <header> <h1><ins>Welcome!</ins></h1> <p> Welcome to my website about Minerals and Rocks!<br> Hopefully you'll find some useful information to help you! </p> </header> <main id="content"> <article> <h2>What a Mineral is</h2> <p> A mineral is a naturally occurring chemical compound. Most often, they are crystalline and abiogenic in origin.<br> A mineral is different from a rock, which can be an aggregate of minerals or non-minerals and does not have one<br> specific chemical composition, as a mineral does. The exact definition of a mineral is under debate, especially <br> with respect to the requirement that a valid species be abiogenic, and to a lesser extent with regard to it<br> having an ordered atomic structure. More information can be found <a href="https://en.wikipedia.org/wiki/Mineral">here</a>! </p> </article> </div> <div id="wrappertwo"> <p> To the right is a short video showing different types of Geodes.<br> Take a look to see the different types you can find, or hopefully<br> buy! </p> </div> <video id="Geodevideo" controls="controls" poster="picofrock.png"> <source src="Geodes.mp4" type="video/mp4"> Your browser does not support the video tag. </video> <img class="geode" src="Geode.png" alt="Geode" /> </main> </body> </html> Error: End tag div seen, but there were open elements. From line 51, column 1; to line 51, column 6 article>↩↩</div>↩↩<div Error: Unclosed element main. From line 34, column 1; to line 34, column 19 /header>↩↩<main id="content">↩↩<art Error: Stray end tag main. From line 68, column 1; to line 68, column 7 eode" />↩↩</main>↩↩</bo Edited October 23, 2016 by luke214 Link to comment Share on other sites More sharing options...
dsonesuk Posted October 23, 2016 Share Posted October 23, 2016 The article can done as you say, if you need sub class articles then you can use sections to separate but keep group together in a article, sections Definition, Mineral chemistry etc Link to comment Share on other sites More sharing options...
luke214 Posted October 23, 2016 Author Share Posted October 23, 2016 The article can done as you say, if you need sub class articles then you can use sections to separate but keep group together in a article, sections Definition, Mineral chemistry etc Ahh that makes more sense, thanks! Still struggling, been looking at this code for ages and can't seem to find the problem! <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta content="My website about Minerals and Rocks" name="description"> <meta content="minerals,rocks,earth,gems" name="keywords"> <meta content="index,follow/" name="robots"> <link href="styles.css" rel="stylesheet" type="text/css"> <link href="geode.ico" rel="icon"> <title>Information about Minerals and Rocks</title> </head> <body> <div id="wrapper"> <noscript>Please enable Javascript</noscript> <header> <h1><ins>Welcome!</ins></h1> <p>Welcome to my website about Minerals and Rocks!<br> Hopefully you'll find some useful information to help you!</p> </header> <main id="content"> <article> <h2>What a Mineral is</h2> <p>A mineral is a naturally occurring chemical compound. Most often, they are crystalline and abiogenic in origin.<br> A mineral is different from a rock, which can be an aggregate of minerals or non-minerals and does not have one<br> specific chemical composition, as a mineral does. The exact definition of a mineral is under debate, especially<br> with respect to the requirement that a valid species be abiogenic, and to a lesser extent with regard to it<br> having an ordered atomic structure. More information can be found <a href= "https://en.wikipedia.org/wiki/Mineral">here</a>!</p> </article> </main> </div> <div id="wrappertwo"> <p>To the right is a short video showing different types of Geodes.<br> Take a look to see the different types you can find, or hopefully<br> buy!</p> </div><video controls="controls" id="Geodevideo" poster= "picofrock.png"><source src="Geodes.mp4" type="video/mp4"> Your browser does not support the video tag.</video> <img alt="Geode" class="geode" src= "Geode.png"> </body> </html> Error: End tag div seen, but there were open elements. From line 51, column 1; to line 51, column 6 article>↩↩</div>↩↩<div Error: Unclosed element main. From line 34, column 1; to line 34, column 19 /header>↩↩<main id="content">↩↩<art Error: Stray end tag main. From line 68, column 1; to line 68, column 7 eode" />↩↩</main>↩↩</bo Link to comment Share on other sites More sharing options...
dsonesuk Posted October 23, 2016 Share Posted October 23, 2016 There is no problem with that code, it looks as that it is what came from previous validation. check it here https://validator.w3.org/nu/#textarea Link to comment Share on other sites More sharing options...
luke214 Posted October 23, 2016 Author Share Posted October 23, 2016 Ahh thanks!Seemed like whenever i tried validating by uploading the file it showed those errors, but when i used the text area it said it's all good! Strange, but thanks anyway! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now