0
Welcome Guest! Login
0 items Join Now

CSS: How to override link style in local case.

  • CSS: How to override link style in local case.

    Posted 13 years 1 month ago
    • I realize this is probably a more generic css question but I have been fiddling with this all morning and am not making any headway. I have some styles I have created that make some css buttons. Not gorgeous, but good enough for me and what I want. I now realize that I need to have these buttons linkable for various reasons. When I add a link inside of these buttons(done in tables), the link style takes over and the buttons look like crap. I don't want to override the main 'a' styling, just in this case.

      I have an easy example set up at www.tabsuwear.com/mistrhanky/index.php?o...cle&id=38&Itemid=321

      This page shows the linked button, an unlinked button, and a plain link. I see that when I disable things like bold weighting(using firebug) in the overall a link it has an effect, but that is not quite what I want as it changes all links on the page, not just the ones in my particular case of the table. Can anyone throw me a bone here? I would be most appreciative.
    • Ben Simon's Avatar
    • Ben Simon
    • Elite Rocketeer
    • Posts: 4301
    • Thanks: 8
    • Full-time web developer

    Re: CSS: How to override link style in local case.

    Posted 13 years 1 month ago
    • There are a few ways to override the "overrides". I would do something like this:
      .styled-button-miscblack a{
      color: #fff !important;
      }
      True you want to stay away from !important but in this case, the styles you are creating are generated right in index.php and will override anything you would normally put in an external stylesheet. You can then add additional properties for font-weight, size, etc.
    • B e courteous to staff and members that volunteer their time helping you
      E ssential Tool - FireBug
      N ever assume I know what version you're talking about

      S earch the forum for a solution first
      I nclude a link to the problem
      M ark your resolved issues as [SOLVED]
      O nly PM moderators if they request it first
      N o...
  • Re: CSS: How to override link style in local case.

    Posted 13 years 4 weeks ago
    • Thanks. That worked perfectly and I see exactly where I was going wrong now.
    • Ben Simon's Avatar
    • Ben Simon
    • Elite Rocketeer
    • Posts: 4301
    • Thanks: 8
    • Full-time web developer

    Re: CSS: How to override link style in local case.

    Posted 13 years 4 weeks ago
    • Glad I could help mistrhanky :)
    • B e courteous to staff and members that volunteer their time helping you
      E ssential Tool - FireBug
      N ever assume I know what version you're talking about

      S earch the forum for a solution first
      I nclude a link to the problem
      M ark your resolved issues as [SOLVED]
      O nly PM moderators if they request it first
      N o...

Time to create page: 0.047 seconds