homepage Welcome to WebmasterWorld Guest from 54.204.141.129
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

This 38 message thread spans 2 pages: < < 38 ( 1 [2]     
It's </p> not <br><br>
Two Soft Returns vs. One Hard Return
pageoneresults




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

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




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

But won't that confuse the search spiders?

g1smd




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

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




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

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




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

<br><br> FTW

karmov




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

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




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

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




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

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

Zaziork




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

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 ( 1 [2]
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved