Jump to content

form problem


rawb

Recommended Posts

My problem is that three input boxes on my form, each of which have { width: 33% }, are displayed on different lines.. up to 666px (scarily enough).  When the width is 667px, all three fit on the same line (which is what I want, but at any width)..

 

The file is here (simplified, obviously):

http://rawbwk.com/test.html

 

The CSS:

* {
  padding: 0;
  border: 0;
  margin: 0;
}

#container {
  width: 666px;
  margin: auto;
  border: 1px solid black;
}

#t1 {
  width: 100%;
}

.t2 {
  width: 100%;
}

.t2 input {
  width: 33%;
  background-color: red;
}

 

 

The HTML:

<div id="container">

  <div id="t1">Test

  <div class="t2">

    <input name="test1"></input>
    <input name="test2"></input>
    <input name="test3"></input>

    </div>

</div>
</div>

 

Thanks in advance...

Link to comment
Share on other sites

Partly, it's a white space issue.  Put all the inputs on the same code line and they all appear in a single 'row'.

 

Fails:

<input name="test1"/> <input name="test2"/> <input name="test3"/>

 

Works:

<input name="test1"/><input name="test2"/><input name="test3"/>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.