The text will overflow .date’s width still rendering, but it will break into multiple lines. does create flow issues though so it really depends on what you’re doing with them.
Ah. I saw that in a comment to Chris Coyer’s “responsive data tables” article/experiment, and kept it in mind… and in your case, the browsers who don’t understand data-foo/content(attr) are the same ones not doing @media stuff anyway.
Since you have the real text somewhere too (and not display: none) you’re also cool with screen readers… recently heard VO started speaking CSS content but traditionally stuff created with :before and :after and “content” were invisible/silent.
Interesting, I’ve planned a visually-pleasing fallback for old browsers but I didn’t know they were the exact same that didn’t support media-queries.
You’re right about accessibility, that’s one of the reasons why I wanted to do it in a clean way like this. Worse case scenario, they’ll hear the month twice. I haven’t found a way to hide content from screenreaders.
Thanks deathshadow60 but as I explained in a previous post, it isn’t a viable option in my case because the dates are generated dynamically, and also because of a language issue :
Thanks ralph.m, your solution is ideal however I’m not sure how easy it is to implement when the date is generated dynamically with a PHP function.
If it’s hard-coded then yes, that’s definitely how I’d do it for a website in English.
However in other languages such as French, the 3 letter abbreviation of the month does not always match the first 3 letters of the actual word.
July is Juillet in French, and the 3 letter abbreviation is JUL (as in English), not JUI.
interesting, but a bit technical for me to understand I’m afraid…
It looks like you’re automatically displaying the first 3 letters of the month, which is not what I’m after since some of the months abbreviations are not the 3 first letters (at least in French)…