+ 7
Replacements for <br />
I have been told by multiple people that <br /> is bad practice. I've noticed that most codes I make that focus on designing websites use this. Without this tag everything is all squashed up. Is there an alternative for this tag that is good practice? I've been told to use "float" in CSS. I've looked on W3Schools but that method doesn't help me that much.
7 odpowiedzi
+ 9
Well I have always used <br> because \n doesn't work here in web.
It really all boils down to formatting and how you want to do it. Depending on context you might want to approach using other CSS ways.
+ 3
I personally use <br> to break up things inside containers rather than to arrange containers, if that makes sense? For example, the placement of divs is probably better controlled using styling rather than separating them with <br>s.
+ 3
You can use margin instead but using br tags doesn't harm.
+ 3
it would be okey to use a div element. this would also make your work more cleaner.
+ 3
what is the problem with <br/> ?
+ 3
Yes maybe <div> and other block level elements?