Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validator miss a p tag but it's 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 W3 Validator (HTML 5) says:

Error Line 81, Column 20: No p element in scope but a p end tag seen.

                </p>

I do have a p tag. What's wrong? Thank you.

like image 467
thomas Avatar asked Dec 17 '22 19:12

thomas


2 Answers

Problem: <p> cannot contain an <address> block

You can nest a <p> inside an <address>! An <address> block just means that there's address information to be found within 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

like image 136
deceze Avatar answered Dec 19 '22 07:12

deceze


The Layout-Problem:

why use a wrapper like 'p or 'div for the layout coding anyway? as a block-level element you can use 'adress directly as your container-box and format it with any css as you like. keep code minimal and simple.

The Semantic-Problem:

also you dont need a wrapping 'p for the semantics, as 'adress explains its contents already very well. just use it ;-)

The Syntax-Problem:

and yes, other answers are right: 'p contains legally only inline-/inline-block-elements, no block-level-elements allowed

like image 23
PeeDeeD Avatar answered Dec 19 '22 07:12

PeeDeeD