html - Custom button next to input not changing border color correctly with BS3 -


i have custom button next input not acting intended. creating overlapping border darker hint when use rgba. shadow adds seems occur in latest version of bs , not 3.0.0.

html

<div class="row">     <div class="col-lg-12 newsletter">         <form method="post" action='/' class="form" id="newsletter-form">             <div class="form-group" id="newsletter-form-group">                 <div class="controls">                     <div class="input-group">                         <input type="text" class="form-control newsletter-input" name="testinput" placeholder="your email address here.." />                             <span class="input-group-btn">                             <button class="btn btn-default newsletter-btn" type="submit">sign up</button>                         </span>                     </div>                 </div>                 <label class="control-label newsletter-status" for="testinput"></label>             </div>         </form>     </div> </div> 

css

/* latest compiled , minified css included external resource*/

 body {     margin: 10px;     background-color:#404040; } .btn:focus, .btn:active, .btn.active {     outline: 0!important; } .newsletter-btn, .newsletter-btn:focus, .newsletter-btn:active, .newsletter-btn.active {     color:#fff;     background-color: rgba(52, 152, 219, 1.0) !important;     border: 1px solid rgba(52, 152, 219, 1.0) !important;     font-weight:500;     border-radius:0!important;     -webkit-transition: .3s;     -moz-transition: .3s;     transition: .3s; } .newsletter-btn:hover {     background-color: rgba(52, 152, 219, 0.5) !important;     border: 1px solid rgba(52, 152, 219, 0.5) !important;     color:#fff!important;     box-shadow: none!important;     -webkit-box-shadow: none!important;     -moz-box-shadow: none!important; } .newsletter input {     box-shadow:none!important;     border-color:#fff!important;     background-color: #fff;     color:#fff;     border-radius:0!important; } 

demo: https://jsfiddle.net/dtchh/7138/

hovernormal

to fix different border color, set border color transparent on hover--you overlapping 2 elements 0.5 opacity, give of lighter border.

.newsletter-btn:hover {     background-color: rgba(52, 152, 219, 0.5) !important;     border: 1px solid transparent !important;     color:#fff!important;     box-shadow: none!important;     -webkit-box-shadow: none!important;     -moz-box-shadow: none!important; } 

to fix funny growing thing, set z-index of button:

.newsletter-btn{     z-index:999; } 

see this functioning fiddle


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -