12 ms·
>>> e.g. adding a line break in the middle of a heading because you want a two word brand name to appear at the start of a line However using a in your
by dmwallin 7y ago
>>> e.g. adding a line break in the middle of a heading because you want a two word brand name to appear at the start of a line
However using a in your brand name would likely be a better way to handle this, and makes actual semantic sense in your html. It's also coincidently more robust to changes in your layouts.
Purity for it's own sake is problematic, and definitely sometimes there won't be a good semantic approach. But thinking through cases a little deeper and trying to represent things better semantically can pay off big dividends by increasing the robustness of your solutions.
- seanwilson 7y ago> However using a in your brand name would likely be a better way to handle this, and makes actual semantic sense in your html. It's also coincidently more robust to changes in your layouts. I don't see how Brand Name is any more semantic than <div class="no-line-breaks"> Brand Name </div> though. Either way, I can't see how there's a general solution for that example. - Maybe for another heading, the break in the middle of the brand name will look better because otherwise the previous line would contain only a single word. - Or the approach works okay for short brand names but not very long ones (e.g. Department for Work and Pensions). - Or maybe for one heading we want a break only because otherwise the brand name is going to overlap with the eyes of a person in a background photo. CSS doesn't even have anything built in to do nice looking justified paragraphs yet (like LaTeX has), let alone simple stuff like dealing with text widows and text orphans. You could conceivably come up with a general algorithm that encodes some of the design heuristics above but that's in the realms of automating graphic design and there's always going to be exceptions. My point is, there's no clean separation between content/data and styling if you want your data presented in a very specific way. For heavily designed pages, this is underscored by it always being unavoidable that you'll end up modify the text content because you want it to look more presentable e.g. changing a heading so it to fits in a tight space or line breaks in a pleasing way.
- mwcampbell 7y agoI think the answer is to give up on wanting things to be presented in a specific way. The user may want, or need, for it to be presented a different way anyway. So just provide the content and let the user agent lay it out as the user needs or wants it.
- seanwilson 7y ago> I think the answer is to give up on wanting things to be presented in a specific way. I can't see how that's ever going to happen. You're going to tell Apple or a professional graphic designer to not care about small details in the way their pages are presented? Raw data and semantics isn't the single most important thing in all cases.
- hjanssen 7y agoYeah, not going to happen anytime soon. Branding is such a big part of every company and the bigger the company gets, the more important it will get. People spend a fortune just to control how every milimeter of their product looks and feels. This is a honourable vision, sure, but also a completely unrealistic one.