When you use, you're using something that differs from other well-known tags in only one trait: they won't let you get away with a specific move. And the only valid reason is, "yeah but why would you do such a thing in the first place". Browsers are tolerant, peaceful and understanding, but not for this one thing. This magic trick caused lots of trouble for WYSIWYG editors, even today it does. The browser will literally (and immediately) tear your tag in two: closes the previous one and opens another. You'll be surprised when you first try to add a inside of a. We know better today.īut some people like standards that rigorously enforce themselves. We're way past that, it's the late 1900s. It's because long ago they imagined HTML as a nice, clean document with some markup, and they named the most common ones with a single letter: you will have bold, italic, underline, umm what else?, sure, links, paragraphs, then headings, etc, it was like building a Word document. Now this may sound weird because everyone keeps recommending the use of p. After you do, they're nothing but a div - again, with a little surprise for tourists. Regarding spaces before/after, like margins and padding, P tags have different defaults across the universe, so the first thing you do is reset them properly. Those are just made-up benefits imagine Google not being able to find text in your divs, or a screen reader standing perplexed in front of a document enclosed in a span. No, not better for screen readers not better for semantics, not better for SEO - nothing like that. P tags have absolutely no special abilities, apart from this intolerant behaviour. Browsers will forcefully alter your HTML when you put another p tag inside a p tag, even if it's just a temporary thing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |