Super quick simple formating question

Tell us what’s happening:
I’m wondering if the p element tags should be on different line than the anchor tags or is the way i have appropriate formating so other coders don’t think I’m a slob.

Just started learning so any advice at all is appreciated.
Your code so far


<p> View More <a href="" target="_blank">cat photos</a></p>

<img src="" alt="A cute orange cat lying on its back.">

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0.

Challenge: Nest an Anchor Element within a Paragraph

Link to the challenge:

If it’s a child of that element you should put it on different lines. Like this:

    Lorem ipsum <strong>dolor sit amet</strong>, consectetur adipisicing elit, 
    sed do <em>eiusmod tempor</em> incididunt ut labore et <code>dolore 
    magna aliqua</code>. Ut enim ad minim veniam, <font size="5">quis 
    nostrud</font> exercitation ullamco <a href="">laboris
    nisi ut aliquip</a> ex ea commodo consequat. 

For inline contents you don’t need to put on separate lines.

I would even go a step further and add another p element like this:

But I’m also new so I’m not really sure lol That might be too much :thinking:

maybe you want a div instead

This depends on your personal likes.

  View More 
  <a href="" target="_blank">
    cat photos

Although it’s a reasonable idea, you don’t want to do that.

  1. the validator will break
  2. p has a semantic meaning, it is a paragraph. paragraph in paragraph doesn’t make that much sense. You want to use a div or, with semantic meaning, a section.
1 Like

Thank you for the advice! I see what you’re saying about div vs p element, I honestly never thought of it like that before lol. I’ll definitely fix that. Makes much more sense now :slight_smile:

And do you mind explaining what you mean about the validator? I’m not sure I know what it is. Thanks!

Hey there,

the World Wide Web Consortium (W3C ) is the organization that sets the “rules” of HTML and CSS.

On their website, they have a Code Validator that checks your code for validity:

1 Like

Wow I never knew about that! This is very helpful lol

Thank you for explaining :slight_smile: