Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    England
    Posts
    172
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS - setting all 'A' attributes in one go?

    In my CSS, I have something like this which sets all the links to one color by default:

    Code:
    A {
    	color: #BLAH1;
    	text-decoration: none
    }
    A:hover {
    	color: #BLAH2;
    }
    A:active {
    	color: #BLAH2;
    }
    The attributes for hover and active are exactly the same. To save space, is there a way of setting them all in one go? For example like this (which I know doesn't work but it gives an idea of what I'm on about..):

    Code:
    A:hover AND A:active {
    	color: #BLAH2;
    }
    ??
    \o/

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    168
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Replacing AND with a comma should do it.

  • #3
    Senior Coder chilipie's Avatar
    Join Date
    Jul 2004
    Location
    Shrewsbury, UK Age: 16
    Posts
    1,117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, A should be a.

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You could also do:

    Code:
    a { blah: blah; }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •