Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Wart Burggraaf
Wart Burggraaf
9,948 Points

HTML semantic markup - Help needed

Hi,

With my new project I try to use semantic markup in the right way. I need a little help with that.

I will turn the ul list into inline-block elements.

My question is: Do I need to put this all into a paragraph or can I just start with an ul list right away?

Here is my code:

<section>
  <h1>Recall. New plant. Equipment review.</h1>
  <p>
    <ul>
      <!-- recall -->
      <li>
        <a href="#">
          <h2>Henk recalled a machine</h2>
          <p>Henk recalled his machine because it was dirty</p>
          <p>Read more</p>
        </a>
      </li>
       <!-- new plant -->
      <li>
        <a href="#">
          <h2>Piet buys a new plant</h2>
          <p>Piet bought it for an egg and a chicken</p>
          <p>Read more</p>
        </a>
      </li>
       <!-- equipment review -->
      <li>
        <a href="#">
          <h2>Jaap dislikes his equipment</h2>
          <p>Jaap dislikes his ugly equipment. He prefers pink</p>
          <p>Read more</p>
        </a>
      </li>
    </ul>
  </p>
</section>

3 Answers

Peter Freeze
Peter Freeze
25,620 Points

Hey Wart -

The <ul> element is a block level element by default, along with the <p>. A <ul> and <p> element should live at the same level in a hierarchy. So, to put it simply, no you do not (and probably should not) place a <ul> element inside of a <p>.

No you start with the <ul> You dont put tags such as <ul> inside <p> tags

Tags you may put inside a <p> tag are <a> <br> <b> etc ones that relate to the text there self

Hope this helps :)

Wart Burggraaf
Wart Burggraaf
9,948 Points

Actually, I'm not sure what you mean.

To answer your question you dont need to put that code in a paragraph tag, Paragraph tags are only really needed when you are writing paragraphs. You are listing information so list tags are ok to start with.

Wart Burggraaf
Wart Burggraaf
9,948 Points

Thanks for helping me out here, you both :)