代码之家  ›  专栏  ›  技术社区  ›  halocursed

使用jquery更改边框底端颜色?

  •  31
  • halocursed  · 技术社区  · 16 年前

    我想用jquery更改下边框的颜色。谢谢。

    4 回复  |  直到 13 年前
        1
  •  54
  •   nil    13 年前
    $("selector").css("border-bottom-color", "#fff");
    
    1. #mydiv $("#mydiv")
    2. .css()
        2
  •  19
  •   John Boker    16 年前
    $('#elementid').css('border-bottom', 'solid 1px red');
    
        3
  •  11
  •   Community Mohan Dere    9 年前

    hilight_css = {"border-bottom-color":"red", 
                   "background-color":"#000"};
    $(".msg").css(hilight_css);
    

    approach

    .hilight { border-bottom-color:red; background-color:#000; }
    .msg { /* something to make it notifiable */ }
    

    $(".msg").addClass("hilight");
    // to bring message block to normal
    $(".hilight").removeClass("hilight");
    

        4
  •  5
  •   Mark Schultheiss    16 年前

    .myApp
    {
        border-bottom-color:#FF0000;
    }
    

    <div id="myDiv">test text</div>
    

    $("#myDiv").addClass('myApp');// to add the style
    
    $("#myDiv").removeClass('myApp');// to remove the style
    

    $("#myDiv").css( 'border-bottom-color','#FF0000');