©Copyright.

The validator skipped the p tag, but it is there!

I have the following markup:

<footer> <p id="foo"> &copy;Copyright. <address><a href="" title="Web Development">Me</a></address>. Todos os direitos reservados. </p> </footer> 

But the W3 Validator (HTML 5) says:

 Error Line 81, Column 20: No p element in scope but ap end tag seen. </p> 

I have a tag p. What's wrong? Thanks.

+4
source share
3 answers

Problem: <p> cannot contain <address> block

You can insert <p> inside <address> ! The <address> block simply means that address information will be found in it. It does not need to be wrapped tightly around the address itself.

http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-address-element

+14
source

Layout problem:

why use a shell like 'p or' div to encode the layout? as an element of the block level, you can use the "address" directly as a container container and format it with any css as you wish. keep the code minimal and simple.

Semantic problem:

also, you don’t need the 'p wrapper for semantics, since the' address explains its contents very well. just use it; -)

Syntax issue:

and yes, the other answers are correct: 'p contains legally only inline / inline block elements, not allowed block level elements

+2
source

Perhaps this is due to the fact that you are using HTML5 tags (which is not yet completed by W3c). So just use the div to support cross-viewing issues.

-4
source

All Articles