How to change css to the download button

The following code toggles a button in a group. I enjoy binding to change the CSS of these buttons, in particular the selected button.

<span class="label label-primary">Age</span> <div class="btn-group" id="ageID"> <button type="button" style="width:120px" class="btnMyAge btn-default" id="3">Under 10</button> <button type="button" style="width:120px" class="btnMyAge btn-default" id="1">Under 50</button> <button type="button" style="width:120px" class="btnMyAge btn-default" id="2">Over 50</button> </div> <script> $(".btn-group > .btnMyAge").click(function () { $(this).addClass("active").siblings().removeClass("active"); }) </script> 

My custom CSS file:

 .btnMyAge, .btn:active { background-color: #ffe13a; } 
+6
source share
2 answers

Change your CSS to

 .active { background-color: #ffe13a; } 

otherwise, background-color applies to all buttons due to the btnMyAge class.

0
source

The background color does not change, but the operator does it in bold. If I delete the first line below from my _Layout.cshtml, does the background work?

  <link href="~/Content/bootstrap.min.css" rel="stylesheet" /> <link rel="stylesheet" type="text/css" href="~/Content/custom.css"> 
0
source

All Articles