Hi,I am having trouble with skipping a line using <p>. Previously, I have always used just a single <p> if i wanted to skip lines, but when i validate, it says it's not valid.
Using <p> as a line break is discouraged. However, the closing </p> is optional in HTML 4.01. It is not optional in XHTML, of course.
It is optional for the web browsers because they need to work ouit how to display the paragraph when you leave it out.
Actually leaving it out of a web page just makes your page harder to maintain and so to save your self errors in the future when you forget where each paragraph ends you should insert a short comment to remind you. </p> is an acceptable format for the comment to take as that is a lot shorter than the alternative <!-- paragraph ends here -->
I agree - I was a bit in pedant mode. That said, the absence of a closing tag for <p> (in HTML) should not cause a false rendering of a page in a browser.
Another good reason for closing tags is that it makes switching to xhtml easier should that ever be appropriate.
I agree - I was a bit in pedant mode. That said, the absence of a closing tag for <p> (in HTML) should not cause a false rendering of a page in a browser.
But empty <p>s should be ignored and not rendered. The problem would be that the validator probably thinks that the p tag contains the following p tag which would be invalid.
Great wit and madness are near allied, and fine a line their bounds divide.
Bookmarks