Welcome to WebmasterWorld Guest from 126.96.36.199
Forum Moderators: incrediBILL
If every piece of content is marked up as a heading, paragraph, list, table, or form, the search engines will have a much easier job to do in parsing and understanding it - and it will also ensure that your CSS works as expected without some random "style bleed" due to unclosed tags or nesting issues making a style "leak" beyond where it was supposed to apply.
These aren't design choices and when I code things by hand, I use pargraph tags. Just some food for thought since this may not always be a religious preference :)
is actually meaningless as it is an optional closing tag in HTML. So in fact you should always consider the immediately adjacent block element to the text following a
to be the marker for the end of a paragraph.
<p>Now is the time for all good men and women to come to the aid of their [b]countries.
<h3>[/b]This h3 element closes the paragraph</h3>
So, it is neither
, it is nothing at all. :)
I noticed this issue on a site I'm developing.
I thought I'd try to dream up a quick fix; I haven't fully tested this yet, but it seems to work for me at least... instead of using the nl2br solution, I'm simply using this code to mark-up all my breaks prior to output:
$s = preg_replace("/\\r\\n\\r\\n/", "</p><p>", $s);
This is for double breaks (for example, where someone hits return/enter twice in an input box in order to create a new parapraph).
It can easily be modified to replace single returns too, but trouble with that is where people have hit return twice it would create empty paras <p></p> in your html.