Feb 8, 2005, 6:25 PM
Re: [afru] <br> vs <p>. Solution for both ie and moz.
all users are interested to avoid it and insert <br>
Certainly when the battle started, the majority were in favour of finding a way of making <p> the standard, and I for one, am still violently in favour of that direction... despite the incredible pain it's caused me trying to implement it. As in,
- There are many good reasons for needing one over the other, all depending on circumstance. Thus, the user should be able to enter one or the other. Now, Microsoft has already made <p> on enter and <br /> on shift-enter the standard by virtue of the fact that it's the long-standing behaviour of Word. Thus, they transferred that behaviour to IE. Rather than resist tradition and write (incredibly MS-centric) code to flip IE's behaviour, EnterParagraphs for Gecko simply brings things up to the standard.
- Historically, enclosing markup in logical paragraphs meant you could operate on markup in logical paragraphs. For example, both browser models carry a 'formatblock' option for the 'execCommand' method, to (theoretically) make formattnig 'blocks' easier. A big chunk of text full of <br />'s was still considered one block, so changing a line of text to <h1> would change your whole document if it only had <br />'s. I see however, that behaviour's now changed =P
- Still on the matter of representationality though, from the css point of view, paragraphs are far preferable to lots of breaks, because you can then alter the margins and padding between paragraphs. While (I think) you could do similar things with <br />'s, you'd be limited and get strange results, because the box model was created with enclosing content in mind, rather than telling elements between bits of content what to do with themselves.