Most of the time, you have to open and then CLOSE the element, but there are some exceptions:
<img>
<meta>
Provides extra information to the browser, like:
<a href="...">
<img src="...">
The two most common attributes are class
and id
.
Block elements take up the full width of the page. <section>
, <p>
, <h1>
, <div>
Inline elements only take up as much space as they need, and are often used inside block elements. <strong>
, <em>
, <span>
You can put elements inside other elements. For example:
<li>
Every HTML document should have the following structure:
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <!-- Your content goes here --> </body> </html>
divs and spans are the bread and butter of HTML. You can make any website using only those and text. But try to use semantic tags where it makes sense.
Semantic tags describe the content, like <header>
, <footer>
, <main>
, <nav>
I gave everyone full credit for the lab if you submitted it, but I do want to show my interpretation of the solution and provide an opportunity for you to ask any follow up questions.