javascript - Transparent form bootstrap over background image -
i'm working bootstrap , can't figure out how texts , forms overlay background image. i've tried other solutions found here, none of them work. i've tried adding bootstrap page creating own css , trying in html page well.
<form class="form-horizontal"> <div class = "form-group"> <label for="inputname" class="control-label col-xs-2">first name</label> <div class = "col-xs-10"> <input type = "text" class="form-control transparent-input" id="inputname" placeholder="name"> </div> </div> <br> <div class = "form-group"> <label for="inputlast" class="control-label col-xs-2">last name</label> <div class = "col-xs-10"> <input type = "text" class="form-control transparent-input" id="inputlast" placeholder="name"> </div> </div> <br> <div class="form-group"> <label for="inputemail" class="control-label col-xs-2">email</label> <div class="col-xs-10"> <input type="email" class="form-control transparent-input" id="inputemail" placeholder="email"> </div> </div> <br> <div class="form-group"> <label for="inputpassword" class="control-label col-xs-2">password</label> <div class="col-xs-10"> <input type="password" class="form-control transparent-input" id="inputpassword" placeholder="password"> </div> </div> <br> <div class="form-group"> <div class="col-xs-offset-2 col-xs-5"> <button type="submit" class="btn btn-primary">register</button> </div> </div> </form>
my css
html{ /* image displayed fullscreen */ /* ensure html element takes full height of browser window */ min-height:100%; /* magic */ background-size:cover; background: rgba(245, 245, 245, 0.7) url('bowling.jpg') no-repeat center center; } body{ /* workaround mobile browsers */ min-height:100%; } .transparent-input { background-color: rgba(0, 0, 0, 0); border:none; }
put container around form, make container 100vh
, can use background-image
declaration on it. it's more reliable target <section>
or <div>
html
.
i wired on codepen you: http://codepen.io/staypuftman/pen/jwjgao
Comments
Post a Comment