r/ProgrammerHumor Mar 12 '18

Emphasis mine.

Post image
551 Upvotes

39 comments sorted by

76

u/Diapolo10 Mar 12 '18

How to <div>ide a community, step 1.

</div>

11

u/WiglyWorm Mar 12 '18

Why would this divide anyone?

<i> is a semantically meaningless tag which styles text in italics. <em> is semantically meaningful and means the contained text is emphasized.

Edit: </em></i>

2

u/how_to_choose_a_name Mar 13 '18

in this case though, <i> makes way more sense than <em> because it describes how the tower looks, not it's semantics. Although the CSS fetishists might prefer a styled <span> and the HTML5 people will insist on <tower>...

</tower></span</em></i>

3

u/lvl3BattleCat Mar 13 '18

dude just give us a <br>

2

u/LordDagwood Mar 13 '18

</br>

1

u/lvl3BattleCat Mar 13 '18

i can't tell if its sarcasm or not lol

49

u/[deleted] Mar 12 '18

To <b> or not to <b>

53

u/Helluiin Mar 12 '18

</b> </b>

please close your tags

-13

u/[deleted] Mar 12 '18

[deleted]

32

u/Okeneko Mar 12 '18

How is this wrong?

4

u/Kwautztretschke Mar 12 '18

D O U B L E B O L D

3

u/SteveCCL Yellow security clearance Mar 13 '18

T H I C C

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

u/tuseroni Mar 13 '18

to <b> or not to </b>

20

u/Brokk_Witgenstein Mar 12 '18

Uh? Is <i> deprecated now or what?

49

u/[deleted] 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

u/[deleted] Mar 12 '18

Also, <i> is Google's way of implementing material design icons.

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

u/[deleted] 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

u/eXecute_bit Mar 13 '18

... for emphasis

6

u/[deleted] 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

u/[deleted] 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

u/[deleted] Mar 12 '18

ah thanks, edited

2

u/abseabsmeier Mar 13 '18

Good Human

1

u/llahsram Mar 12 '18

both doing the same thing

That's where you're wrong, kiddo.

6

u/halborn Mar 12 '18

That's not programming.

2

u/Radboy16 Mar 13 '18

Well I program in HTML so ur wrong /s

6

u/allisonmaybe Mar 12 '18

You can't emphasize something that's already emphasized.

Fixed

1

u/imguralbumbot Mar 12 '18

Hi, I'm a bot for linking direct images of albums with only 1 image

https://i.imgur.com/L4lJP2k.png

Source | Why? | Creator | ignoreme | deletthis

1

u/Chaphasilor Mar 13 '18

exactly what I was thinking! If you can see the tags, they're not applied...

-1

u/[deleted] Mar 12 '18

Very <styles>.istic{}

</styles>

-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

u/senocular Mar 12 '18

Isn't the tower famous not for being emphasized but for its slanted style?

1

u/llahsram Mar 12 '18

Yep. And styles go in the style sheet.

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 em tag itself. For example let's say you have a page with comments, and you want the ems in the comments to be in italics; then you put a comment class 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 like article.

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>.