SitePoint Sponsor

User Tag List

Results 1 to 15 of 15

Hybrid View

  1. #1
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    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:

    HTML Code:
    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?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,175
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    You can just use the same syntax as above. However, if you want to target just a particular <a>, then you'd need something more specific. E.g.

    Code:
    <div class="header">
      <p>This is <a href="">a link</a> in a paragraph.</p>
    </div>
    you can style this like so:

    Code:
    .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.

  3. #3
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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?

    HTML Code:
    .header a {
      reset:resetall; /*I'm making these up*/
    }
    Quote Originally Posted by ralph.m View Post
    You can just use the same syntax as above. However, if you want to target just a particular <a>, then you'd need something more specific. E.g.

    Code:
    <div class="header">
      <p>This is <a href="">a link</a> in a paragraph.</p>
    </div>
    you can style this like so:

    Code:
    .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.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,175
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by ameerulislam View Post
    Is there a short cut to get the default behavior?
    Yes, the shortcut is not to remove it in the first place.

  5. #5
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Yes, the shortcut is not to remove it in the first place.
    yeah right lol.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,175
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    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.

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by ameerulislam View Post
    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?
    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.

  8. #8
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    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.

  9. #9
    Galactic Overlord gold trophysilver trophybronze trophy
    HAWK's Avatar
    Join Date
    Aug 2003
    Location
    New Zealand
    Posts
    12,540
    Mentioned
    956 Post(s)
    Tagged
    14 Thread(s)
    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.

  10. #10
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HAWK View Post
    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.

  11. #11
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,175
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by ameerulislam View Post
    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.

  12. #12
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    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.


Bookmarks

Posting Permissions

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