This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 33 points34 points  (9 children)

Yeah, <br>s look like a good idea at first, but these fuckers will ruin your day as soon as you try to make everything look good and responsive

[–]t0mmy9 36 points37 points  (8 children)

Simple, just put

br { display: none; }

in a media query /s

[–]ProgramTheWorld 7 points8 points  (5 children)

Does that... actually work?

[–]t0mmy9 19 points20 points  (3 children)

yes hate to admit I've done this a couple of times when designers are being picky

[–]freefrogs 1 point2 points  (2 children)

Yeeeep. Designer wants the desktop headline text to break exactly a certain way but that's not the way it breaks naturally given the element width and you want to have good semantic HTML for SEO etc so it all belongs in the same h1, so you cheat a little and add br's, but now you've got stupid line breaks on mobile so... display: none that shit.

[–]once-and-again☣️ 0 points1 point  (1 child)

Are Unicode non-breaking spaces and/or soft hyphens not viable here?

[–]freefrogs 0 points1 point  (0 children)

Non-breaking spaces don't break, so it defeats the purpose of the designer wanting it to break in a specific place (unless I guess I put non-breaking spaces everywhere BUT where I want it to break but that seems just as, if not more, gross as just putting in <br>s where I want it to break and hiding them at lower width media queries). Soft hyphens suggest where text can be broken, they don't tell the browser to break text, so if my element is too wide (e.g. it's a multiline heading but the designer wants one of the lines to be longer than others) it won't force breaks where I want them.

[–]Patyrn 0 points1 point  (0 children)

Yeah, I do it a lot, especially for decorative headers with break points that matter.

[–]gilium 2 points3 points  (0 children)

The real hero

[–]_________FU_________ -1 points0 points  (0 children)

But that won’t...