Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

help me with Pseudo-classes and CSS Classes

Featured Replies

i am trying a simple mouseover with a css classes on my a hrefs but cannot get it to work???

Here is just a simplified one but i still cant get this going.

 

my html is

 

<a class="red" src="">shane</a>

 

and CSS

 

a.red:link{ color:yellow;}

a.red:hover{color:red}

a.red:visited{color:#F00}

a.red:active{color:#C96}

 

the link is staying black??? but the hover is working. why is the color yellow now showing?

 

i have posted this simple site at

 

http://www.shaneprendergast.co.uk/folder/practice.html

 

cheers shane

Edited by webknit

you havent closed the styles with a ; - for example a.red{color:red;}

sorry misread I think but if you lose the :link it should work - not sure if its right but it works.

  • Author

what change

 

 

 

a.red:link{ color:yellow;}

 

to

 

a.red{ color:yellow;}

 

nope that dont work

 

i have figured it out now on my site but ive no idea what i was doing wrong, just looking at why this is not working now i am baffled?

I'm pretty sure it was because you didn't include the href attribute once that was added it shone yellow!!

try this order

 

a:link

a:visited

a:hover

a:active

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.