css - What is best way to create Input Group like Bootstrap but without Flex? -


i want create input group scratch bootstrap, don't want use flex, best way create input group? think older versions of bootstrap have used display: table have heard it's not best way because in browsers safari works in way ...

for example :

<div class="iptgroup">     <span>@</span>     <input type="text"></input> </div> 

i had code , used display: table neither worked in -webkit- browsers (some problems in width of span) or worked in firefox ...

any answer appreciated ...

i see nothing bad in using display: table; , table-cell :

/*quickreset*/  *{margin:0;box-sizing:border-box;}  html,body{height:100%;font:14px/1.4 sans-serif;}  input, textarea{font:14px/1.4 sans-serif;}    .input-group{    display: table;    border-collapse: collapse;    width:100%;  }  .input-group > div{    display: table-cell;    border: 1px solid #ddd;    vertical-align: middle;  /* needed safari */  }  .input-group-icon{    background:#eee;    color: #777;    padding: 0 12px  }  .input-group-area{    width:100%;  }  .input-group input{    border: 0;    display: block;    width: 100%;    padding: 8px;  }
<div class="input-group">    <div class="input-group-icon">@</div>    <div class="input-group-area"><input type="text" placeholder="email address"></div>  </div>  	  <div class="input-group">    <div class="input-group-icon">income:</div>    <div class="input-group-area"><input type="text" value="0.00"></div>    <div class="input-group-icon">$</div>  </div>


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -