0

I have a button like the following:

CSS

.Btns {
        width:200px;              
        height:75px;
        background-color:lightblue;
        color:black;
        font-weight:bold;

    }

HTML:

<button id="btnProduct" type="button" class="Btns" >

JQUERY:

$("#btnProduct").html('<span style="background-color:red;width:100px">Production:</span></br></br><span class="blue">55</span>');

I want upper part of my button to be red,as you see in my code I gave my span 100% but still has not filled the whole of upper part of button.

$("#btnProduct").html('<span style="background-color:red;width:100px">Production:</span></br></br><span class="blue">55</span>');
.Btns {
  width: 200px;
  height: 75px;
  background-color: lightblue;
  color: black;
  font-weight: bold;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button id="btnProduct" type="button" class="Btns">
 
</button>
Richard Parnaby-King
  • 14,703
  • 11
  • 69
  • 129
papagallo
  • 145
  • 7

1 Answers1

4

You don't need no js or anything else weird to do this, just use css :

.Btns {
  width:200px;
  height:75px;
  background:linear-gradient(to bottom, red, red 50%,  lightblue 50%, lightblue);
  color:black;
  font-weight:bold;
}
kevinniel
  • 1,088
  • 1
  • 6
  • 14