Firefox, display issues on a input form HTML/CSS -
i don't know why on firefox when type in input text hidden (but when click out of input text display), on google chrome works well, try change z-index doesn't change anything.
this html
<div id="searchbar" class="{% if query %}cancelable{% endif %}"> <input class="searchinput" type="text" autocomplete="off" value="{{ query|default_if_none('')|escape }}" name="query" id="keywords"/> <input type="submit" value="" name="search" class="searchbtn" style="display: none;"/> </div> this css
#searchbar input.searchinput { z-index: 99; font-size: 22px; height: 26px; line-height: 26px; font-weight: 300; background: #fff; border: 0px; color: #484848; font-family: arial; width: 100%; margin: 8px 0 6px 0; padding: 0 80px 0 8px; top: 0; left: 0; -webkit-box-shadow: 0 0 0 #929292; -moz-box-shadow: 0 0 0 #929292; box-shadow: 0 0 0 #929292; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } #searchbar input.searchinput:focus { margin: 0px 0 0px 0; padding: 20px 40px 18px 8px; border: solid 1px rgba(82, 168, 236, 0.8); -webkit-box-shadow: 0 0 0 rgba(82, 168, 236, 0.8); -moz-box-shadow: 0 0 0 rgba(82, 168, 236, 0.8); box-shadow: 0 0 0 rgba(82, 168, 236, 0.8); box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -webkit-transition:border linear .2s, box-shadow linear .2s; -moz-transition:border linear .2s, box-shadow linear .2s; -o-transition:border linear .2s, box-shadow linear .2s; transition:border linear .2s, box-shadow } ps : #searchbar has z-index of 1000 try switch 10 still has same behavior on firefox.
you've large amount of padding causing issue , using height of 26px , hence text hides
padding: 20px 40px 18px 8px; you can remove red border later(i've kept test purposes)
few tips on refactoring code
- this margin:
0px 0 0px 0;can writtenmargin: 0; - no need of shadow in code set
0 z-indexnot requiredline-heightnot required(if aren't using fixed height)top,leftnot required
Comments
Post a Comment