Welcome to WebmasterWorld Guest from 54.227.110.209

Forum Moderators: incrediBILL

Message Too Old, No Replies

It's </p> not <br><br>

Two Soft Returns vs. One Hard Return

     

pageoneresults

1:24 pm on Feb 7, 2006 (gmt 0)

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Why do web designers do this?

Now is the time for all good men and women to come to the aid of their countries.
<br>
<br>

Instead of...

<p>Now is the time for all good men and women to come to the aid of their countries.</p>

Which is correct? :)

Clinton Labombard

9:36 am on Feb 12, 2006 (gmt 0)

5+ Year Member



But won't that confuse the search spiders?

g1smd

9:43 am on Feb 12, 2006 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



No, quite the opposite.

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.

Hester

9:20 am on Feb 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Every item on your page should be marked up. Hence the term HyperText Markup Language. But there are other reasons. One is that you can then use the DOM in JavaScript to access each element easily.
___It also makes customising sites within the browser possible. (Ideally each element should have a unique ID, but I guess that's not gonna happen. But so long as the main container divs have IDs, then all is well.)
___This approach also makes styling - and redesigning - your site much easier.

carguy84

12:39 am on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<br><br> FTW

karmov

12:56 am on Feb 14, 2006 (gmt 0)

10+ Year Member



I would like to mention that the nl2br function in php has certainly had an impact in the proliferation of break tags on certain portions of my website.

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 :)

encyclo

3:15 am on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member



As we are getting down to the nitty-gritty on this,
</p>
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
<p>
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

</p>
nor
<br><br>
, it is nothing at all. :)

g1smd

7:31 pm on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



The </p> is optional in HTML 4.01 Transitional, but move up to Strict, or to XHTML, and it is always Required.

Zaziork

3:01 pm on Mar 16, 2006 (gmt 0)

10+ Year Member



Karmov wrote on Feb 14": I would like to mention that the nl2br function in php has certainly had an impact in the proliferation of break tags on certain portions of my website."

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.

This 38 message thread spans 2 pages: 38
 

Featured Threads

Hot Threads This Week

Hot Threads This Month