html - Input transition -


i try animate search button.
when click on it, should expand , slide side.
animation no problem in css, in front of search bar div, not follow expanding search bar.

<form>     <div class="test"></div>     <input type="search" placeholder="search"> </form>  form{   float:right; }  input[type=search] {   background: #e75757 url(http://nerdlove.de/blog/img/search_icon.svg) no-repeat 15px center;     background-size: 25px;   border: none;   padding: 10px 10px 10px 10px;   width: 35px;   -webkit-transition: .5s;   -moz-transition: .5s;   transition: .5s;     text-indent:-999px; }  input[type=search]:focus {   width: 150px;   background-position: -30px;   text-indent: 0px; }  .test{     float:left; }  .test:before{     content: no-close-quote;   border-top: 40px solid rgba(0, 0, 0, 0);   border-left: 0px solid rgba(0, 0, 0, 0);   border-right: 18px solid #e75757;   float: right;   right: 55px;   position: absolute; } 

example

i add :before input. not possible in css.

edit
here want

just position .test element relative , :before right: 0;.

.test{     float:left;     position: relative; }  .test:before{     content: no-close-quote;   border-top: 40px solid rgba(0, 0, 0, 0);   border-left: 0px solid rgba(0, 0, 0, 0);   border-right: 18px solid #e75757;   float: right;   right: 0;   position: absolute; } 

demo


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -