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 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2007
    Location
    FL
    Posts
    35
    Thanks
    4
    Thanked 0 Times in 0 Posts

    override default color

    I am trying to change the color of a row when its matches some parameter.
    when i see the code i see the the have the right style but its being overwritten by another.


    When i inspect the element i see that this takes priority than what i want
    Code:
    .table > tbody > tr:nth-child(2n) {
        background: none repeat scroll 0 0 #F7F7F7;
    }
    Code:
    .green_bg {
        background: none repeat scroll 0 0 #009900;
    }

  • #2
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    400
    Thanks
    2
    Thanked 30 Times in 30 Posts
    give the row an id and then change it with:
    document.getElementById('yourid').style.backgroundColor='#009900';

    or create a new class with the prperties you want ant swap with:

    document.getElementById('yourid').className='yourNewClass';
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&


  •  

    Posting Permissions

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