Jump to content

Termination of <p> tag?


Bule

Recommended Posts

I'm using the W3C HTML validator to make sure I don't have errors in my HTML as I learn about it This error is throwing me a bit. It complains about

Line 56, Column 7: No p element in scope but a p end tag seen.
This is the section of HTML around there
<p>   Just a simple unordered list   <ul>	 <li>Item unordered 1</li>  <li>Item unordered 2</li>  <li>Item unordered 3</li>   </ul>   </p>   <p>   Just a simple ordered list   <ul>

It seems that the unordered list forces termination of the paragraph? If that is correct, then the sentence "Just a simple unordered list" should be delimited by the </p> tag? And thus, if I wanted an "association" between the sentence and the table, the way to do it is with a <div> tag?

Link to comment
Share on other sites

What do yuou mean by an "association between the sentence and the table"? You can use an element such as a <span> tag within a <p> as it is inline and has no margin or padding values by default, IIRC. I always use <span>'s inside <p> elements if I want a different style applied to an area of text. Regards, Lab.

Link to comment
Share on other sites

What do yuou mean by an "association between the sentence and the table"?
I think he means "semantic association", as in "it's meant to be this way", as opposed to "it looks this way".
And thus, if I wanted an "association" between the sentence and the table, the way to do it is with a <div> tag?
Lists, tables, and any non-inline element can't be part of a paragraph, as already stated. So yes, if you want to group a piece of text and something else, it's best to surround the group with a different element, such as "div".
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...