Is removing a link underline on hover not WCAG compliant? - accessibility

I'm trying to find a definitive answer to this accessibility question. If I set the underline on all links by default...
a {
text-decoration: underline;
}
...and remove the underline on hover...
a:hover {
text-decoration: none;
}
...is this no longer WCAG 2.0 compliant?
There's a bit of gray area with the W3C's Success Criterion. Per "Failure of Success Criterion 1.4.1 due to creating links that are not visually evident without color vision":
Link underlines or some other non-color visual distinction are required (when the links are discernible to those with color vision).
We know that a link with default styling that doesn't include an underline fails the success criterion even if the underline is applied on hover. Because as stated above, "other non-color visual distinction are required". Is the same true in reverse?
I've seen a few accessibility tools (e.g., SiteImprove) flag the lack of underline on hover even when it's present for default styling. Does anyone know definitively what the answer is?

#graham is spot on but a few other things to consider that can't fit into a comment area.
Bear in mind that you don't have to underline links. You just have to make them visually identifiable with something other than just colour.
You don't necessarily have to distinguish with more than color if the links are all by themselves. It's usually only a problem if you have links embedded in a paragraph with plain text. Then you need to make sure the links look different from other text besides using just color.
Likewise with your comment:
We know that a link with default styling that doesn't include an underline fails the success criterion even if the underline is applied on hover.
We actually don't know that it fails the success criterion. It depends on the context and design as I'll explain below.
An important part of accessibility with regards to WCAG is to understand that documentation/specs can be normative or non-normative (the latter is also called informative).
Normative is required for conformance and non-normative/informative is not. However, non-normative is usually pretty good advice (best practice) so it's often a good idea to follow it, but not following it doesn't mean you're not conformant to WCAG.
See "5.1 Interpreting Normative Requirements":
The main content of WCAG 2.1 is normative and defines requirements that impact conformance claims. Introductory material, appendices, sections marked as "non-normative", diagrams, examples, and notes are informative (non-normative). Non-normative material provides advisory information to help interpret the guidelines but does not create requirements that impact a conformance claim.
As an example, the intro section of WCAG says it's non-normative.
The failure you quoted, F73, is non-normative. Even if you have that pattern, "links that are not visually evident without color vision", that doesn't mean you necessarily fail WCAG. It goes back to my first comment about links by themselves. F73 even mentions that:
While some links may be visually evident from page design and context, such as navigational links, links within text are often visually understood only from their own display attributes.
In other words, it depends on the design.
As an example, look at https://webaim.org/. The paragraph text color is black. "The results of WebAIM's...".
There's a link below the text that is blue and underlined which is a typical practice but ignore that link for now. Just note that the paragraph text is black.
Near the top of the page is a list of navigation links. They are black too.
So now there is plain text that is black and links that are black and when looking at just color, you can't tell the difference. However, the design of the page makes it apparent that the text at the top are links so it wouldn't fail 1.4.1 or F73.
Even though this doesn't fail, WebAIM still has a hover and focus state that changes the color of the link and they have a slight shadow when hovered and focused. That makes for a better user experience but isn't necessarily needed for WCAG.
All that being said, you are ok if you remove the underline upon hover with regards to WCAG conformance but you should still ask yourself is it's a good user experience.

I am afraid you are unlikely to find a definitive "you can do that" or "can't do that".
However in this scenario where the link is identifiable in text without hovering due to the underline, I cannot think of any success criterion you would fail by removing that underline on hover.
I am making the assumption that there is a visible focus indicator if some focuses links of course.
I am also assuming that you don't change the cursor behaviour and there will be a cursor: pointer when you hover the links.
Bear in mind that you don't have to underline links. You just have to make them visually identifiable with something other than just colour.
This could be making the text bold, italicised, larger etc.
If you are at all worried then making them bold as well as underlined (or even just bold when hovered and remove the underline on hover) would make sure the link will always have some visual distinction in all states.
The only other thing to consider...link state can be identified by colour alone (visited and active for example) so I would consider hover to just be another state.
The only other final "argument" I have is that of expected functionality. It is one of the largest aspects of accessibility. Would a user expect the underline to be removed on hover? Could that cause confusion or unsettle someone with an anxiety disorder?
I would say it is fine but that might be one for user testing to get a definitive answer!
I am aware this answer has ended up as "opinion", but it is at least educated opinion and the short answer is "it passes WCAG given the information provided"...I just wanted to explain some considerations I would have if I were assessing this for accessibility.

The first answer is, the link you provided is to a completely obsolete very early working draft from 2008. And be careful at the W3 site, it's a a bit of a mess and unfortunately fairly easy to get stuck on the wrong document.
Disclaimer: As an Invited Expert of the W3C my statements in this post are mine alone and do not necessarily reflect the official views of the W3C or AGWG. 😇
Second is to read the current pages. Unless you have a specific need to, don't use WCAG 2.0, use the current recommendation, 2.1, or the current draft moving toward consensus 2.2.
Here is the correct page in the actual 2.0
Here is that page in the current 2.1
Here is that page in the pending 2.2
Third if I haven't annoyed you yet, you might be interested in the Advanced Readability Forum at the github for APCA, and this post in particular:
A Discussion of Inline Links (Theory and Practice)
It's the start of a thread and there's a lot of other similar topics, comments of course are welcome.
Note: the link is to a discussion, and is not part of a normative standard yet.

Related

Where is the source of this Heisenbug for a Wordpress twentysixteen child theme?

I am working on a child theme to Wordpress's twentysixteen theme, and one boilerplate move is to restore text-decoration underline to links.
For some links, as below, this results in two lines, not one, under the text, unless you hover over. If you hover over the link one of them goes away. (In other words, I may have a Heisenbug that defeats the usual song and dance for when CSS is a bit off.)
Needless to say, this somewhat complicates the process of using Chrome's Inspect Element feature. My working hypothesis is that there is a border-bottom or the like in twentysixteen, possibly due to an accessibility concern that some people handle descenders more easily if an underline is lower than browser defaults. However, after inspection via Chrome's Inspect Element, and some effort to wade through the basic twentysixteen's style.css, I am not entirely sure what the correct way is to say, "I want all links underlined, and no double underlining."
If I want to keep text-decoration: underline for links, how can I remove the additional underline?

Overcoming cross-browser issues designing UI elements

I'm currently changing the look of select elements on my page and I noticed that almost every browser displays all the effects differently. That is not so bad alone but I also noticed that some browsers do not support some effects at all, for example Chrome does not support background image, rounded corners and probably something else I've not yet noticed.
I have seen some pretty impressive drop down menus on some websites where everything has been custom made, starting from the glows to the appearance of the arrow button and so on.
How is it done? Is it done with some Javascript/jQuery plugin?
Can anyone point me to some good resources?
I would suggest you go down the path of a jquery plugin. Doing a search for "jquery select box" returns a number of useful results, eg:
http://www.designdim.com/2011/07/10-important-jquery-selectboxdropdown-plugins/
I have tried out a number of these before, and some are more flexible than others.
One that I really like that is not in that list is Chosen, although it doesn't fully support IE7 and 8.

Google+ Games Buttons

I have no idea how to even start this question, but I was referred to Stack Overflow by a friend who basically told me that anything I need help with or to help others, I should come here. So I have a question for website designers and coders alike. (optional: have a google+ account for a visual aid)
If you go into Google+, you have all these cool features that seem advanced with code, but very basic in style. You hover over a button and it becomes animated like the in the games section. You have an image of the game in a div container I believe and it cycles through like its a gif or a timed sequence. At the bottom of the image, you see a small box from left to right, filled in with a different color, and has the name of the game on it. When you hover over said game a box begins to move from the bottom of the div to the top of the div completely covering up the image, but has more details in it. These details includes the description of the game and a button at the bottom that is a dark bluish that says play game, and when you hover over it, then it becomes a light blue like color.
Basically I want to create the same thing, but with different attributes. Same concept initially with the picture and the box with the name with a white border, but when you hover over it, then the background would be like a dark red with white text and a dark red button with a white border with the words view site and when you hover over it then it is like a light red.
I am making a portfolio website for my website designs and photoshop work. I think that this would be a great addition and I hope somebody or anyone can help me. I always give credit in my about pages if I didn't actually create something on my own.
Thank you for your time on reading this ridicuously long question, but I hope it relatively makes sense.
Your question makes sense and you can totally do it, personally I recommend learning HTML & CSS and creating a working demo - then hiring someone / finding someone to help build the features you want it to have. That way you have total control of the appearance, which I think is something that you're more interested about then coding the features ( you mention showcasing your design work ).
http://learn.shayhowe.com/html-css/terminology-syntax-intro/
Is a nice resource I saw today that might help you get started. In the future I think Stack Overflow is much more affective for specific questions related to specific issues, not something so broad as to code and design an entire web application.
Best of luck!

How can I use CSS3 ::selection without changing the default color and background color?

The following lines are included in the HTML5 Boilerplate template by default:
::-moz-selection{background:#fe57a1;color:#fff;text-shadow:none;}
::selection{background:#fe57a1;color:#fff;text-shadow:none;}
However, I want to keep the selection color as the OS default (blue in Windows, I think it's brownish orange in Ubuntu). If I leave out the background property, there will be no background.
Since this selector is not officially supported for CSS, being removed from CSS3 and not currently in the draft for CSS4, there really isn't much documentation on how exactly the selector should be applied.
As defined by the selector, it is meant to override the system's default text selection colors. The browsers have apparently taken this literally. By specifying ::selection, those colors are immediately overwritten, even if you haven't specified them. The problem is the system's defaults are not part of CSS. The browser is seeing your declaration and thinking "ignore the system's default, use what's in this declaration instead." Since you don't have colors specified there, no colors are applied (background is none and color is inherit). Whoops, kind of hard to tell your text is selected, huh?
This is only a theory of what appears to be happening since, as I said, there really is no documentation on what actually happens, or what is supposed to happen.
Honestly, the only way you'd really know for sure is to look at the source code and see what it's doing when it sees that selector. Maybe asking someone on the development team for one of these browsers would be easier. Either way would still be difficult. Maybe you could submit a bug report and they can delve into the issue a little more...

Re-learning CSS the right way [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am a programmer doing web development for over two years now. Even though I’ve been doing front end engineering for the past two years I don’t think I have done it the right way
For instance:
I still do layout with tables and not with just CSS. I haven’t still found out a way to correctly present data aligned and tabular.
I don’t know the difference between display: none and visibility: hidden (well, I know it now. but there are many cases like- padding, margins, overflows etc)
I haven’t really followed the inheritance way to writing CSS. Almost every style starts with a # and not a class.
Whenever a page loads slowly the html elements are out of place and fall into order only when it’s completely loaded.
I don’t know what this picture in firebug is conveying (by the way, firebug is my savior. Life would have been impossible without Firebug)
Whenever layout’s in a mess I am tempted to use position:absolute. Invariably it ends up in a bigger mess.
I know I am doing a lot of things wrong(and I need to get it right) here but I manage to get things into place and somehow show it up, only to see it messed up in a different browser.
I don’t want do a primer on CSS or CSS for dummies. I know more than that. I want to learn CSS the right way. Focusing on problems like the examples I showed above and rectifying them.
Can you point me to resources or add common suggestions and tips used by CSS developers to get it right.
Check out Designing With Web Standards by Jeffrey Zeldman.
Here are some general rules to live by:
Tables are good for tabular data. If the data you're presenting belongs in a table, don't go out of your way trying to make a grid out of <div>s. Doesn't make sense.
As far as layout is concerned, use <div> tags, stay away from tables. Get to know the float property well. With CSS3, there are going to be new, improve standards to the display property. Learn them.
display: none completely removes the element from the viewport. Conversely, visibility: hidden retains the whitespace that the element would have otherwise taken up. In both cases, the element remains in the DOM.
General rule of classes and IDs. Page elements and IDs should have a one-to-one relationship per page. For example, #Column1, #Column2, #Footer, #Header. Page elements and classes, on the other hand, should be a many-to-one relationship, like: .container or .navLink. Use classes when you know you're going to be using a particular element quite a bit.
Think in terms of efficiency. The less style rules you have, the more quickly your page will load and the easier style issues will be to debug.
I have about a million other things to say but that should get you started.
For layout-driven CSS, be sure to check out Everything You Know About CSS Is Wrong. It's a bit cutting edge, since IE 7 doesn't support display: table (pity, I know), but it does cover traditional layout CSS techniques like floating and absolute positioning, and provides a good transition from table-based layouts to CSS ones. I highly recommend it.
I don't know if you're building off of any dynamic language or if you're just coding raw HTML, but you should also look at using SASS in your projects, as I think it helps force you to pay more attention to inheritance. Otherwise, reviewing more "rudimentary" tutorials (like CSS for Dummies) might actually be helpful, as they go over a lot of CSS's fundamental principals in detail.
Lastly, CSS works best when you have semantically correct (x)html underneath the hood. In my opinion, it's easiest to see and learn "good" CSS when you have great, semantically correct html underneath. Here's a good overview of when to use what tags. Generally, I find it best to write my content with no regard what-so-ever to how it will look later, then use CSS later to make it gorgeous.
As always, you can pick up lots of neat tips and tricks at CSS Tricks, which have always helped me learn more about the correct usage of the language (like when I learned about overflow: auto for contained floating elements! Genius!).
Hope that helps!
Visit CSS Zen Garden to see what you can do only with CSS.
Visit W3 schools and follow the tutorial. It might seem simple for you, but you will learn the basic stuff.
Visit some sites, such as A list Apart to see how to do things and learn tricks.
See if a CSS framework suits your needs (such as 960 Grid).
I'm assuming you've installed Firebug?
Also, http://www.doctype.com might get more relevant results.
Practice, practice, practice. You know what you don't know, and that is the key to success in my mind. Every project you do, try to improve your skills, and eventually it will become second nature to do it the right way.
Eric Meyer's Cascading Style Sheets 2.0 Programmer's Reference is a great resource to understand exactly how selectors and rules work, and serves as a great reference as well.
Some thoughts on what you posted.
A Master Reset style sheet will
help with browser differences.
And Tabular data should use tables.
It's layouts that should avoid table
tags in favor of css.
Plenty of people here give good advices. I'll just add two more:
First, try to write valid (X)HTML. You can easily test your HTML code using W3C's HTML validator. Focus mainly on content, not on style.
Second, try to write valid CSS, preferably in a separate .css file. Avoid using the style attribute. (This part can be hard, if you want to support certain old browsers from Redmond). You can test your CSS using W3C's CSS validator.
Read CSS: The Definitive Guide by Eric Meyer. He explains why CSS was created, how it works (according to the standards), and will give you the background to understand the finer points. It also makes a good reference.
Experiment in Firebug
I don’t know what this picture in
firebug is conveying
Firebug itself can help you there. Do this:
Create a div with some text in it.
Use CSS to give it padding: 5px; margin: 5px; border: 1px solid black;
Examine it in Firebug, as you show in your question.
Click on any one of those numbers in the box model it's showing you, and start pressing the up and down arrows (or type a different number).
See how it changes in real time? This is one of the best things about Firebug: it lets you tweak without reloading, then modify your stylesheet when it looks right.
Keep doing this until you understand how padding, margins, and border work.
I think you should use, for your layout needs, one of the so called "css frameworks" (960.gs for example).
They are fast and reliable enough to build cross-browser layouts and also easy to read and understand as well, so you can learn all the good practices while you are coding.
CSS are easy and aren't a real programming language: don't be afraid of the word "framework" ;)
You could start by reading some good books on the matter. The ones of Eric Meyer are hands on and of very high quality. The other book that of which I learned a lot was the Zen of CSS design book.
And the rest is effort and practice. Be sure that you understand why something works the way it does, don't be satisfied with 'trial-and-error' css development.
http://www.amazon.com/Zen-CSS-Design-Visual-Enlightenment/dp/0321303474/ref=sr_1_1?ie=UTF8&s=books&qid=1255629419&sr=8-1
http://www.amazon.com/More-Eric-Meyer-Voices-Matter/dp/0735714258/ref=sr_1_1?ie=UTF8&s=books&qid=1255629449&sr=8-1
http://www.amazon.com/Eric-Meyer-CSS-Mastering-Language/dp/073571245X/ref=sr_1_1?ie=UTF8&s=books&qid=1255629462&sr=8-1
Well, I will address some of these issues as best I can.
The difference between display:none and visibility:hidden is when the display is set the space for that item is not reserved. So imagine it as when the display is set the item is 'gone' off the page. Whereas if you are using the visibility option, the elements are on the page, in their place just invisible. Did I explain that clearly? Hopefully, that makes sense for you.
As far as the padding, border and margins, this is all referred to as the CSS Box Model. The information is contained as the element, its padding, border, then its margins. So padding is the distance between the element's content and its border whereas the margin is the distance between the border and the neighboring element. Again, I hope this helps clear this up for you a little bit.
Transitioning to CSS is sometimes tricky but well worth it.
Well the basics are quite simple, you should really get a hang of the quite easy if you've already don't some css coding.
The best practices, browser quirks, hacks and other sketchy stuff concerning crossbrowser layout is something else.
Here is my suggested reading list, all of them are on my bookshelf and certainly worth reading! If you ask me i'd say these are the book you should have read if you are a webdesigner.
Designing with webstandards
CSS Mastery
Bulletproof webdesign
for me, Pro CSS and HTML Design Patterns by Michael Bowers changed it all. no more endless trial-and-error, but problem - pattern - solution. indispensable.
Whenever a page loads slowly the html elements are out of place and fall into order only when it’s completely loaded.
Are you putting your stylesheets at the top, in the <head> section?
Are you declaring explicit sizes for images, or does the browser have to guess, then rearrange things when the image shows up?
Depending on your learning style, I might recommend going straight to the source: the definition of CSS. You can find each of the various specs here: http://www.w3.org/Style/CSS/. While the specification doesn't really cover specific browser quirks (if it did, they wouldn't be quirks, would they?), it does a really good job (for me) of explaining how each piece works.
I will tell you my secret: follow this two classic tutorials
Listutorial
Floatutorial
And you'll know 80% of what you need to know about CSS.
30 Websites to follow if you’re into Web Development
http://htmldog.com/ is, in my opinion, one of the definitive resources to learning front-end web development the proper way.

Resources