HTML
HTML
1
• Start with
<html></html>
2
• <body></body>
• <h1> </h1>biggest, <h6> smallest
• <main></main
• <p>paragraph </p>
• Indentation 2 spaces
• <img> self closing tag
• All img elements should have an alt attribute. Loads if img fails to
show.
• <img src="cat.jpg" alt="A cat">
• <!– comment start….-->
HTML attributes are special words used inside the
opening tag of an element to control the element's
behavior.
The src attribute in an img element specifies the image's URL (where the image
is located).
• https://cdn.freecodecamp.org/curriculum/cat-photo-
app/relaxing-cat.jpg
Before adding any new content, you should
make use of a section element to separate the
cat photos content from the future content.
• <section>
• <h2>Cat Photos</h2>
• <!-- TODO: Add link to cat photos -->
• <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat
photos</a> in our gallery.</p>
• <a href="https://freecatphotoapp.com"><img
src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg"
alt="A cute orange cat lying on its back."></a></section>
When you add a lower rank heading element
to the page, it's implied that you're starting a
new subsection.
unordered list (ul) element
• <ul>
• <li>cat nip</li>
• <li>laser pointers</li>
• <li>lasagna</li>
• </ul>
the figure element represents self-contained
content and will allow you to associate an
image with a caption.
<figure><img src="https://cdn.freecodecamp.org/curriculum/cat-photo
app/lasagna.jpg" alt="A slice of lasagna on a plate."></figure>
A figure caption (figcaption) element is used to add
a caption to describe the image contained within the
figure element. For example, <figcaption>A cute
cat</figcaption> adds the caption A cute cat.
<figure>
<img
src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg"
alt="A slice of lasagna on a plate.">
<figcaption>Cats love lasagna</figcaption>
</figure>
Emphasize the word love in the figcaption element
by wrapping it in an emphasis em element.