G
G
Gleb2016-08-11 11:23:17
HTML
Gleb, 2016-08-11 11:23:17

br tag not working in firefox?

When you add a tag <br>, FireFox remakes it into <br></br>something that shifts the element if you remove it <br>normally displays. Tried all options: <br>, <br />, <br/>still closes it.
This is chrome.
83a6b2e56e8a4875ad29b7503383755c.png
This is FF
c2c5b7d125d345698843abb73b88b912.png
Doctype <!DOCTYPE html>
How to solve this problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor Vasiliev, 2016-08-11
@Isolution666

I don't know what to say to this)) Browsers have long been a headache for programmers.
There is another way:

<pre>
       <strong>
              ул. Дмитрия Мартынова, 47
              2-40-40-93, 2-415-818
       </strong>
   </pre>

no one has canceled the tag <pre>yet, it allows you to display hyphens without <br/>if they actually exist in the text.
Bootstrap offers an interesting solution
<address>
  <strong>Twitter, Inc.</strong><br>
  795 Folsom Ave, Suite 600<br>
  San Francisco, CA 94107<br>
  <abbr title="Phone">P:</abbr> (123) 456-7890
</address>

<address>
  <strong>Full Name</strong><br>
  <a href="mailto:#">[email protected]</a>
</address>

bootstrap-3.ru/css.php#type-addresses
For some reason, using this framework, there are no problems <br>. Well, in extreme cases, try to avoid this tag. Now they treat it with contempt, since css3 decides everything
. For example, you have a text that needs to be divided into three columns when it is removed from the database. Force user to draw html table tags <table>??? Tabular layout is also a thing of the past, like a bad dream, what to do? And it's very simple, css has such a parameter that forms the columns siteis.ru/html-i-css-retsepty/razbivka-teksta-na-k..., and at will there can be more or less of them, this situation can really be beaten in adaptive layout. Make one column if the site is viewed from a mobile device. As you can see, there are a lot of ways to transfer, and you don’t even need it <br>, learn css - and life will be happier and easier.

D
Denis Kharchenko, 2016-08-11
@itprodavets

Everything is working. Send the html text itself, you can link to jsbin

Z
zooks, 2016-08-11
@zooks

This end tag is a legacy of XHTML. Everything should display as it should.
When written <br>(HTML5) at least the latest versions of Firefox in the inspector show a normal view.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question