Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 07-11-2014, 06:15 AM
Phil in Abbeville Phil in Abbeville is offline
Contributing Member
 
Join Date: 07-05-08
Location: Lafayette, LA
Posts: 237
iTrader: 0 / 0%
Why all the hate for the <br> tag?

Until the last year, I've always used straight up HTML to code.
I've since switched over to Wordpress as well started working with shopping carts like OpenCart for a sideline gig that I'm doing.
For the most part, I don't have a lot of complaints using a CMS. They definitely have their benefits. But one thing I've having a hard time wrapping my head around is the fact that every one of them seems to have this aversion for the <br> tag.
Why?
Back in the day it was a quick as easy way to get some space between elements. Without fail, every site I work on wants to convert any line-breaks to <p> tags and sometimes, that really screws everything up. Especially with floats.
I've tried a couple of plugins, but they don't work and sure, there are work-arounds, but why should I have to go to the trouble?
To my knowledge, the <br> tag has no effect on validating or anything of that nature (or at least it shouldn't).
I just want to know why. What is the developers reasoning for such things?
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 07-11-2014, 09:08 PM
rtrethewey rtrethewey is offline
Junior Member
 
Join Date: 01-30-12
Posts: 9
iTrader: 0 / 0%
You're mostly running into quirks of the HTML editor built into WordPress. Generally, it is best practice to use margins to separate block-level elements so you can control the separation more precisely in your stylesheet than you can with a <br> element - which becomes more important when you start working with responsive design to accommodate different platforms.
 
Reply With Quote
  #3  
Old 07-12-2014, 03:14 AM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,016
iTrader: 4 / 100%
<br> is an unclosed tag and will trip up some validation scripts. <br /> is a self closing tag and passes just fine.
 
Reply With Quote
  #4  
Old 07-12-2014, 06:19 AM
Phil in Abbeville Phil in Abbeville is offline
Contributing Member
 
Join Date: 07-05-08
Location: Lafayette, LA
Posts: 237
iTrader: 0 / 0%
Yes, it does happen almost exclusively with the HTML Editor, but sometimes I use the WYSIWYG editor just to simple text editing. And closing the tag does seem to help.
But again, back to original question?
Why??
I don't see how the <br> tag takes away from the responsiveness of a site.
And the few plugins I've tried don't work.
 
Reply With Quote
  #5  
Old 07-12-2014, 07:28 AM
carrieathomer carrieathomer is offline
Contributing Member
 
Join Date: 09-20-11
Posts: 66
iTrader: 0 / 0%
In wordpress, you have to modify the editor to allow break tag. But in the next update it will reset.

Break tag is good, it just upto programmer to use it or not.

some use margin:10 0 on all the p tag

so they don't have to br tag
 
Reply With Quote
  #6  
Old 07-12-2014, 10:50 PM
snakeair snakeair is offline
Super Moderator - Rest in Peace 2018
 
Join Date: 12-31-07
Location: Medford, NJ
Posts: 54,771
iTrader: 3 / 100%
Quote:
Originally Posted by carrieathomer View Post
In wordpress, you have to modify the editor to allow break tag. But in the next update it will reset.

Break tag is good, it just upto programmer to use it or not.

some use margin:10 0 on all the p tag

so they don't have to br tag
Did you read the opening post and replies first?
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't you hate it when ... ? rabble Forum Lobby 18 06-04-2010 02:39 PM
Hate comments and hate mail juliascissor Blogging Forum 10 02-26-2009 11:16 AM
I hate Being the New Guy!!! optic5 SEO Forum 12 01-07-2004 05:08 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 03:55 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC