Hi! My code passes all of the tests except for Step 6- the empty header test. I have read similiar posts and haven’t found a solution. Reallly appreciate the help. Thanks!
<!doctype html>
<html lang="en"></html>
<head>
<meta charset= "utf-8">
<meta name="viewport" content="width=device-width intial scale=1.0">
<link rel="stylesheet" href="styles.css">
<title>HTML & CSS Beginners Guide</title>
</head>
<body>
<div class="app">
<div class="menu-toggle">
<div class="hamburger">
<span></span>
</div>
</div>
<aside class="sidebar">
<nav class="menu" id="navbar">
<header>menu</header>
<a href="#Intro_to_HTML_&_CSS?" class="nav-link">Intro to HTML & CSS?</a></li>
<a href="#HTML_Elements" class="nav-link">HTML Elements</a></li>
<a href="#HTML_Attributes" class="nav-link">HTML Attributes</a></li>
<a href="#What_is_CSS?" class="nav-link">What is CSS?</a></li>
<a href="#CSS_Basics" class="nav-link">CSS Basics</a></li>
<a href="#CSS_Syntax_&_Selectors" class="nav-link">CSS Syntax & Selectors</a></li>
</nav>
</aside>
</div>
<script>
const menu_toggle = document.queryselector('.menu-toggle');
const sidebar = document.querySelector('.sidebar');
menu-toggle.addEventListener('click', () => {
menu_toggle.classlist.toggle('is-active');
sidebar.classlist.toggle('is-active');
})
</script>
<main class="content" id="main-doc">
<section class="main-section" id="Intro_to_HTML_&_CSS?">
<header>Intro to HTML & CSS?</header>
<h2>What is HTML5?</h2>
<p>HTML5 is officially not a programming language. HTML5 stands for Hypertextmarkup Language. HTML describes the structure of the webpage. It consists of elements that tell the browser how to display content. Elements help keep content structured and organized.</p>
<h2>HTML Basic</h2>
<p>In HTML there are some basics that every page needs to have. One example is the !Doctype declaration. This declaration helps browsers display web pages correctly.</p>
<p>Two more examples are the html and body elements. All html documents need the html element, why? I'm not sure. The body element is where all content that will be visible goes.</p>
<p>Another HTML basic that is very important are headings. Headings are defined by importance by the h1-h6 tags.
</p>
<code></code>
</section>
<section class="main-section" id="HTML_Elements">
<header>HTML Elements</header>
<p> What is an HTML Element? An HTML element is everything from the opening tag to the closing tag. This includes the content inbetween. Some example elements are the already mentioned h1 element, p element, and a element for links. </p>
<code></code>
</section>
<section class="main-section" id="HTML_Attributes">
<header>HTML Attributes</header>
<p>All elements can have attributes. Attributes provide additional information and they are always specified in the opening tag. They are usually in the format of "name=value". For example "id=attributes".</p>
<ul><h4>Example Attributes</h4>
<li>background </li>
<li>border</li>
<li>class</li>
<li>color</li>
<li>id</li>
<li>label</li>
<li>loop</li>
<li>low</li>
<li>max</li>
<li>media</li>
<li>method</li>
</ul>
<code></code>
</section>
<section class="main-section" id="What_is_CSS?">
<header>What is CSS?</header>
<p>CSS stands for Cascade Style Sheets. It is the language we use to style HTML pages. CSS describes how HTML elements should be displayed. CSS saves us a lot of work by allowing us to control the layout of multiple webpages all at once.</p>
<p>The history of CSS really helps us understand why we use it today. IT helped us solce a big problem. When HTML was created, it wasn't intended for tags like font. This created a problem that CSS was able to fix.</p>
<code></code>
</section>
<section class="main-section" id="CSS_Basics">
<header>CSS Basics</header>
<p>css basics </p>
<code></code>
</section>
<section class="main-section" id="CSS_Syntax_&_Selectors">
<header>CSS Syntax & Selectors</header>
<p>css syntax & Selectors</p>
<code></code>
</section>
</main>
</body>
The test can fail to find the code if the code has too many syntax errors. Use the validator link and fix the errors you see one by one. (The warnings can be ignored)
I assume you have some CSS that might be causing it. Might be the nav as it looks like you have implemented a mobile nav, and you have a header element inside it. Post your CSS.
Hi! Thank you! I fixed the errors but still am having problems with an empty header. Any help would be greatly appreciated.
<html lang="en">
<head>
<meta charset= "utf-8">
<meta name="viewport" content="width=device-width intial scale=1.0">
<link rel="stylesheet" href="styles.css">
<title>HTML & CSS Beginners Guide</title>
</head>
<body>
<div class="app">
<div class="menu-toggle">
<div class="hamburger">
<span></span>
</div>
</div>
<aside class="sidebar">
<nav class="menu" id="navbar">
<header>menu</header>
<a href="#Intro_to_HTML_&_CSS?" class="nav-link">Intro to HTML & CSS?</a>
<a href="#HTML_Elements" class="nav-link">HTML Elements</a>
<a href="#HTML_Attributes" class="nav-link">HTML Attributes</a>
<a href="#What_is_CSS?" class="nav-link">What is CSS?</a>
<a href="#CSS_Basics" class="nav-link">CSS Basics</a>
<a href="#CSS_Syntax_&_Selectors" class="nav-link">CSS Syntax & Selectors</a>
</nav>
</aside>
</div>
<script>
const menu_toggle = document.queryselector('.menu-toggle');
const sidebar = document.querySelector('.sidebar');
menu-toggle.addEventListener('click', () => {
menu_toggle.classlist.toggle('is-active');
sidebar.classlist.toggle('is-active');
})
</script>
<main class="content" id="main-doc">
<section class="main-section" id="Intro_to_HTML_&_CSS?">
<header>Intro to HTML & CSS?</header>
<h2>What is HTML5?</h2>
<p>HTML5 is officially not a programming language. HTML5 stands for Hypertextmarkup Language. HTML describes the structure of the webpage. It consists of elements that tell the browser how to display content. Elements help keep content structured and organized.</p>
<h2>HTML Basic</h2>
<p>In HTML there are some basics that every page needs to have. One example is the !Doctype declaration. This declaration helps browsers display web pages correctly.</p>
<p>Two more examples are the html and body elements. All html documents need the html element, why? I'm not sure. The body element is where all content that will be visible goes.</p>
<p>Another HTML basic that is very important are headings. Headings are defined by importance by the h1-h6 tags.
</p>
<code></code>
</section>
<section class="main-section" id="HTML_Elements">
<header>HTML Elements</header>
<p> What is an HTML Element? An HTML element is everything from the opening tag to the closing tag. This includes the content inbetween. Some example elements are the already mentioned h1 element, p element, and a element for links. </p>
<code></code>
</section>
<section class="main-section" id="HTML_Attributes">
<header>HTML Attributes</header>
<p>All elements can have attributes. Attributes provide additional information and they are always specified in the opening tag. They are usually in the format of "name=value". For example "id=attributes".</p>
<h4>Example Attributes</h4><ul>
<li>background </li>
<li>border</li>
<li>class</li>
<li>color</li>
<li>id</li>
<li>label</li>
<li>loop</li>
<li>low</li>
<li>max</li>
<li>media</li>
<li>method</li>
</ul>
<code></code>
</section>
<section class="main-section" id="What_is_CSS?">
<header>What is CSS?</header>
<p>CSS stands for Cascade Style Sheets. It is the language we use to style HTML pages. CSS describes how HTML elements should be displayed. CSS saves us a lot of work by allowing us to control the layout of multiple webpages all at once.</p>
<p>The history of CSS really helps us understand why we use it today. IT helped us solce a big problem. When HTML was created, it wasn't intended for tags like font. This created a problem that CSS was able to fix.</p>
<code></code>
</section>
<section class="main-section" id="CSS_Basics">
<header>CSS Basics</header>
<p>css basics </p>
<code></code>
</section>
<section class="main-section" id="CSS_Syntax_&_Selectors">
<header>CSS Syntax & Selectors</header>
<p>css syntax & Selectors</p>
<code></code>
</section>
</main>
</body>
</html>
we can’t do anything with this response because we can’t see your code. Please share all the code you are trying in one reply so we can also try it. (or just use the code you already posted?)
The code I’ve been using is above. Here is all the code in one post.
<html lang="en">
<head>
<meta charset= "utf-8">
<meta name="viewport" content="width=device-width intial scale=1.0">
<link rel="stylesheet" href="styles.css">
<title>HTML & CSS Beginners Guide</title>
</head>
<body>
<div class="app">
<div class="menu-toggle">
<div class="hamburger">
<span></span>
</div>
</div>
<aside class="sidebar">
<nav class="menu" id="navbar">
<header>menu</header>
<a href="#Intro_to_HTML_&_CSS?" class="nav-link">Intro to HTML & CSS?</a>
<a href="#HTML_Elements" class="nav-link">HTML Elements</a>
<a href="#HTML_Attributes" class="nav-link">HTML Attributes</a>
<a href="#What_is_CSS?" class="nav-link">What is CSS?</a>
<a href="#CSS_Basics" class="nav-link">CSS Basics</a>
<a href="#CSS_Syntax_&_Selectors" class="nav-link">CSS Syntax & Selectors</a>
</nav>
</aside>
</div>
<script>
const menu_toggle = document.queryselector('.menu-toggle');
const sidebar = document.querySelector('.sidebar');
menu-toggle.addEventListener('click', () => {
menu_toggle.classlist.toggle('is-active');
sidebar.classlist.toggle('is-active');
})
</script>
<main class="content" id="main-doc">
<section class="main-section" id="Intro_to_HTML_&_CSS?">
<header>Intro to HTML & CSS?</header>
<h2>What is HTML5?</h2>
<p>HTML5 is officially not a programming language. HTML5 stands for Hypertextmarkup Language. HTML describes the structure of the webpage. It consists of elements that tell the browser how to display content. Elements help keep content structured and organized.</p>
<h2>HTML Basic</h2>
<p>In HTML there are some basics that every page needs to have. One example is the !Doctype declaration. This declaration helps browsers display web pages correctly.</p>
<p>Two more examples are the html and body elements. All html documents need the html element, why? I'm not sure. The body element is where all content that will be visible goes.</p>
<p>Another HTML basic that is very important are headings. Headings are defined by importance by the h1-h6 tags.
</p>
<code></code>
</section>
<section class="main-section" id="HTML_Elements">
<header>HTML Elements</header>
<p> What is an HTML Element? An HTML element is everything from the opening tag to the closing tag. This includes the content inbetween. Some example elements are the already mentioned h1 element, p element, and a element for links. </p>
<code></code>
</section>
<section class="main-section" id="HTML_Attributes">
<header>HTML Attributes</header>
<p>All elements can have attributes. Attributes provide additional information and they are always specified in the opening tag. They are usually in the format of "name=value". For example "id=attributes".</p>
<h4>Example Attributes</h4><ul>
<li>background </li>
<li>border</li>
<li>class</li>
<li>color</li>
<li>id</li>
<li>label</li>
<li>loop</li>
<li>low</li>
<li>max</li>
<li>media</li>
<li>method</li>
</ul>
<code></code>
</section>
<section class="main-section" id="What_is_CSS?">
<header>What is CSS?</header>
<p>CSS stands for Cascade Style Sheets. It is the language we use to style HTML pages. CSS describes how HTML elements should be displayed. CSS saves us a lot of work by allowing us to control the layout of multiple webpages all at once.</p>
<p>The history of CSS really helps us understand why we use it today. IT helped us solce a big problem. When HTML was created, it wasn't intended for tags like font. This created a problem that CSS was able to fix.</p>
<code></code>
</section>
<section class="main-section" id="CSS_Basics">
<header>CSS Basics</header>
<p>css basics </p>
<code></code>
</section>
<section class="main-section" id="CSS_Syntax_&_Selectors">
<header>CSS Syntax & Selectors</header>
<p>css syntax & Selectors</p>
<code></code>
</section>
</main>
</body>
</html>
Thank you for improving my formatting and for all of your continued help! This is strange, I tried my code again on chrome instead of safari and it worked! It was failing " 6. None of your header elements should be empty." I don’t know if this makes any sense and have zero evidence but maybe it was my safari settings related to javascript?