Setting back to default behavior

Let say I set some rules for an anchor tag at the top of my css sheet like the following:

a{

	text-decoration: none;
	color: #000;

}

Then I needed some part to have the default anchor tag rules like the underline and the blue color. I know I can re-declare the colors, but is there a syntax to do this fast?

You can just use the same syntax as above. :slight_smile: However, if you want to target just a particular <a>, then you’d need something more specific. E.g.

<div class="header">
  <p>This is <a href="">a link</a> in a paragraph.</p>
</div>

you can style this like so:

.header a {
  color: green;
  text-decoration: underline;
}

There are lots of other info, though, depending on your HTML, so we’d need to see a specific example to give better advice.

I’m sorry if I have not been clear enough. I’m okay with targeting and yes as you just had to re-declare values of those particular properties. Is there a short cut to get the default behavior?

.header a {
  reset:resetall; /*I'm making these up*/
}

Yes, the shortcut is not to remove it in the first place. :slight_smile:

yeah right lol.

The ideal is not to add/remove any styling that you then have to undo later on. So it sounds like a better idea for you to target the links for which you want the underline removed, and leave the rest alone.

In my case I’m removing underline from all except few specific places.

If you don’t mind it not working in IE<8, you can use :not(), which allows you to specify styling for, eg, all <a> elements except those that you give a particular class to. As you would expect, this has worked in Opera, Firefox, Chrome and Safari since fairly shortly after the dawn of time, but IE has only got round to implementing it in v9.

Sounds great. I’ll try it out… I should care less about IE<8.

There will be when its supported as the “all” property will do this:

You will just have to wait a little while for browsers to implement it assuming it gets past the working draft.

This sounds even better.

Hi @ameerulislam;
If you haven’t solved the problem yet and you’re keen to get it done on-the-spot, you could try out a new product that we’ve built at SitePoint called Codefix.
Our CSS experts work through your problem with you live until you have a fix.

Head on over to codefix.sitepoint.com if you’re interested.

Nice product, I can’t find the fee’s structure.

At the moment it’s being tested and looking for candidates to test it on, so HAWK is offering it to you as a free process.

That’s a great opportunity.