Content: Issue with ":visited": Needs to mention background-color only works with a default color.

Created on 11 Feb 2021  ·  5Comments  ·  Source: mdn/content

MDN URL: https://developer.mozilla.org/en-US/docs/Web/CSS/:visited

What information was incorrect, unhelpful, or incomplete?

Article mentions that background-color is a supported style of :visited, but this is partially true. The style only works if the anchor tag already has a background color property. Otherwise, it is ignored.

Specific section or headline?

Privacy restrictions

What did you expect to see?

A note regarding this behavior.

Did you test this? If so, how?

Yes, I created a codepen with this demonstrated.

https://codepen.io/nessthehero/pen/poNNdoQ



MDN Content page report details

10 minute task CSS

Most helpful comment

This is actually covered in the examples and the info above them: https://developer.mozilla.org/en-US/docs/Web/CSS/:visited#examples

So this is not specific to background-color, as the text explains, the example then goes on to show setting a background-color. I don't think we need to duplicate this information.

All 5 comments

I can update this 👍

What would be the best? Shall I put a paragraph below the enumeration of the css properties
Allowable CSS properties are color, background-color, border-color, border-bottom-color, border-left-color, border-right-color, border-top-color, column-rule-color, outline-color, text-decoration-color, and text-emphasis-color.
Note: background-color will only be applicable if the anchor tag already has the background-color property.

Also I haven't tried it but I would assume that this behavior will be the same for the other css properties.

@CreaTorAlexander I assigned it to you.

Perhaps start with the note and then add additional properties once it's in?
The commit message then could have a „relates to #” instead of „fixes #”.

This is actually covered in the examples and the info above them: https://developer.mozilla.org/en-US/docs/Web/CSS/:visited#examples

So this is not specific to background-color, as the text explains, the example then goes on to show setting a background-color. I don't think we need to duplicate this information.

Thanks @rachelandrew ; yeah, looks like we can close this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lychyi picture lychyi  ·  3Comments

foolip picture foolip  ·  3Comments

tjcchen picture tjcchen  ·  3Comments

yukulele picture yukulele  ·  4Comments

rachelandrew picture rachelandrew  ·  4Comments