beta.blog

CSS: Display input and div next to eachother (left: dynamic, right: fixed size)

by on Jan.03, 2017, under Programming

Result:

divB

HTML Code

<div id="container">
    <div id="divB">divB</div>
    <div id="divA">
      <input type="text" style="width: 100%" placeholder="this is the default text of this textbox" />
    </div>
</div>

CSS Code

#divB
{
  border:1px solid red;
  float:right;
  width: 100px;
}
#divA
{
  border: 1px solid aqua;
  overflow: hidden;
  padding-right: .5em;
}
:

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!