April 3, 201610 yr I have decided to show the URLs for links when someone prints a page from my website and have CSS code that works fine to do this, but it causes my stylesheet for printed media to break the W3C CSS validation that I worked so hard to get. And I can't figure out how to make my code conform to the W3C standards. The code I have been using in my stylesheet for printers is this : /* Show URL */ a:link:after, a:visited:after { content:" [" attr(href) "] "; } Does anyone have CSS3 that will print the link URLs without breaking W3C standards?? Thanks for any suggestions.
April 3, 201610 yr You could add the URL as a title attribute then use something like: a[title]:after{ content: attr(title); }
April 3, 201610 yr Author Thanks, BlueDreamer, an interesting suggestion. It wouldn't have occurred to me to try that. Unfortunately ... I just now tried it on the fly and it elicited that same Parse Error from the validator that my original code caused. I have no idea why. 34 a[title]:after Value Error : content Parse Error attr(title)
April 3, 201610 yr Author Yes, I am inclined to agree. Torn between principle and practicality, I am considering just removing the W3C badges from my pages and leaving the CSS as it is. I'm sure that others have struggled with this kind of choice too. Thanks for your input.
April 4, 201610 yr Does anybody really care about those badges? Ask your friends if they even knows what those badges mean. I bet most of them won't even know who the W3C are.
April 4, 201610 yr Does anybody really care about those badges? Ask your friends if they even knows what those badges mean. I bet most of them won't even know who the W3C are. I actually agree with this. Also the W3 CSS validator is horrible, I only pay attention to their HTML validator.
April 4, 201610 yr Also the W3 CSS validator is horrible... ...with all sorts of weird rules that make no sense.
April 4, 201610 yr Author Thanks, fisicx and rbrtsmith, and I agree. None of my "normal" friends know or care who the W3C is, but web developers know and (I think) should care. The W3C community has made a tremendous contribution to the development of the web, especially during the years of the browser wars (yeah, I am that old), but I expect it has been difficult for them to keep up with the technical changes brought by the present plethora of new devices. Still, for a bunch of volunteers they have made a huge difference in the way things are done, most for the better, I think. Just my opinion. Having said that, I am still seriously considering removing the badges since my CSS is not strictly compliant (for print media). Like you, rbrtsmith, I am more concerned about the html (which is compliant).
Create an account or sign in to comment