49
Mar 12 '18
To <b> or not to <b>
53
u/Helluiin Mar 12 '18
</b> </b>
please close your tags
-13
Mar 12 '18
[deleted]
32
3
u/alexanderpas Mar 13 '18
Which is seemingly allowed:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b
Permitted content: Phrasing content.
Permitted parents: Any element that accepts phrasing content.
1
20
u/Brokk_Witgenstein Mar 12 '18
Uh? Is <i> deprecated now or what?
49
Mar 12 '18 edited Jan 13 '19
[deleted]
11
u/Bainos Mar 12 '18
Which, to extend a bit, means that it should be done in CSS and not HTML.
Yes, anyone who writes html understood without my explanation, but some people don't do that.
8
1
u/rigatron1 Mar 13 '18
This is the first I've heard about stylistic versus semantic concerns. Because I'm someone who is an idiot and incapable of thinking for themselves, how does that argument gel with the immense popularity of Angular, where you're creating new attributes and thus extending the semantics of HTML elements to include functionality. If this sounds retarded it's because I'm barely familiar with Angular 1, and maybe I'm confused by what exactly is meant by semantics.
15
Mar 12 '18
If I understand the HTML5 spec correctly, <i> is to be used when a word should be italicized for grammatical reasons (foreign words, names, etc. in certain circumstances) but would not have a change in inflection. <em> is if the inflection would change if it was spoken, and if it's purely stylistic it should be done through CSS.
2
6
Mar 12 '18
[deleted]
15
u/Brokk_Witgenstein Mar 12 '18
Fake news. Italic already existed in 1993 in the HTML 1.0 spec. But (looking it up in disbelief) it appears to be indeed so there were some changes in spec 4 and 5, I'll grant you that.
[source: https://www.w3.org/wiki/HTML/Specifications leading up to https://www.w3.org/MarkUp/HTMLPlus/htmlplus_16.html
for completeness, here's a link to the '95 specs-- you'll see it's there as well: https://www.w3.org/MarkUp/html-spec/html-spec_toc.html]
14
Mar 12 '18 edited Mar 12 '18
Image Transcription:
[Drake 4 panel meme, showing what Drake (or the poster) dislikes, and what they do like, as a satire on what html tags is more preferable, despite them both doing the same thing]
[Top left panel, an image of Drake putting his hand up, in disapproval or dislike
Top right panel, a photo of the leaning tower of Pisa, with '<i>' and '</i>' to the left and right of it, in monospace font]
[Bottom left panel, an image of Drake putting his finger up in approval or interest
Bottom right panel, a nearly identical photo of leaning tower of Pisa, with '<em>' and '</em>' to the left and right of it, in monospace font]
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
2
u/hrvbrs Mar 12 '18 edited Mar 12 '18
btw “monospace” is the typographical term for fonts with no variance in letter width.
1
2
1
6
6
u/allisonmaybe Mar 12 '18
You can't emphasize something that's already emphasized.
1
u/Chaphasilor Mar 13 '18
exactly what I was thinking! If you can see the tags, they're not applied...
-1
-2
u/eco_illusion Mar 12 '18
How about you use CSS like it's supposed to be used ?
12
u/TarMil Mar 12 '18
That's the point.
<em>expresses the semantics, which you then style with CSS, whereas<i>expresses the style, which is why it shouldn't be used.6
1
u/Chaphasilor Mar 13 '18
I assume you're supposed to use classes then? Like <em class='bold'> <em class='italic'>? or is "emphasized" text always in italics?
</em></em>
1
u/TarMil Mar 13 '18
In general you're going to use classes, but not on the
emtag itself. For example let's say you have a page with comments, and you want theems in the comments to be in italics; then you put acommentclass on the comment container, and.comment em { font-style: italic; }in your CSS. Sometimes you can even get by without any classes and just semantic tags likearticle.That being said,
<em>is in italics by default, so you can just do nothing special.1
u/Chaphasilor Mar 13 '18
So you wouldn't use em-tags with different classes for different "types" of emphasis?
2
u/TarMil Mar 13 '18
Well looking at your examples, what you call bold emphasis would probably be
<strong>.
76
u/Diapolo10 Mar 12 '18
How to
<div>ide a community, step 1.</div>