-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
back-link is underlined when no href is provided #1171
Labels
🕔 hours
A well understood issue which we expect to take less than a day to resolve.
Milestone
Comments
Hey @penx :) It seems useful to be able to see when you mistakenly did not put a href by being consistent with regular links... I think we would move the .govuk-back-link[href] {
// Use border-bottom rather than text-decoration so that the arrow is
// underlined as well.
border-bottom: 1px solid govuk-colour("black");
text-decoration: none;
} |
NickColley
added
Type: technical-improvement
awaiting triage
Needs triaging by team
labels
Feb 4, 2019
kellylee-gds
added
submitted-by-user
🕔 hours
A well understood issue which we expect to take less than a day to resolve.
and removed
awaiting triage
Needs triaging by team
labels
Feb 6, 2019
NickColley
added a commit
that referenced
this issue
Oct 25, 2019
"Browser default behaviour is to underline anchors only when an href is provided. This is to ensure users can identify links on a page (an anchor without an href is not considered a link by default). This feature also has the side effect of helping developers realise that they may have missed an href attribute - as they can visually see on the page that a link is not underlined." Fixes #1171
m-green
pushed a commit
that referenced
this issue
Nov 13, 2019
"Browser default behaviour is to underline anchors only when an href is provided. This is to ensure users can identify links on a page (an anchor without an href is not considered a link by default). This feature also has the side effect of helping developers realise that they may have missed an href attribute - as they can visually see on the page that a link is not underlined." Fixes #1171
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following HTML:
https://codesandbox.io/s/4wylrj5w
Browser default behaviour is to underline anchors only when an href is provided. This is to ensure users can identify links on a page (an anchor without an href is not considered a link by default).
This feature also has the side effect of helping developers realise that they may have missed an href attribute - as they can visually see on the page that a link is not underlined.
The way the back-link is coded uses border-bottom instead of an underline, but this is not implemented as per normal anchor styles.
The old way browser default styles did this was as follows:
In newer browsers, the
:any-link
pseudo-selector can be used, though it has limited supporthttps://developer.mozilla.org/en-US/docs/Web/CSS/:any-link
I would recommend adding
a[href]
or ``:any-link` to the back-link component and wherever else you may be overriding anchor underline styles, so that you mirror browser default behaviour for anchors, help users identify links and help developers identify errors.The text was updated successfully, but these errors were encountered: