No p element in scope but a p end tag seen.w3c validation

后端 未结 3 1190
南方客
南方客 2021-01-31 02:11

My HTML is as as below. I have opened all elements and closed them. Still when I check it on w3c it shows error. I cant figure it out.



        
3条回答
  •  不要未来只要你来
    2021-01-31 02:44

    That's because you are nesting a block level element inside the p tag which is invalid. You can only nest inline elements such as span, a and img inside p tag. So your markup is invalid, consider making something like

    to provide a drive-in services.

    to provide a drive-in services.


    From W3C[1] :

    The P element represents a paragraph. It cannot contain block-level elements (including P itself).

    1 - Reference

提交回复
热议问题