471,599 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 software developers and data experts.

Having trouble with floats

219 100+
I'm having a problem where my submit button isn't floating over to the right inside of the div. It's supposed to be inside of the "test" div, but it's just below it. What am I missing? This is just a test snippet I was working with to get this functionality to work correctly.

Expand|Select|Wrap|Line Numbers
  1. <div id="mainT">
  2.     <div id="test">
  3.         <h4>Enter New Values and Submit</h4>
  4.             <label>ID: </label>#URL.system#
  5.             <input class="submitT" type="Submit" value="Submit">
  6.     </div>
  7. </div>
  8.  
Expand|Select|Wrap|Line Numbers
  1. div#mainT{
  2.    border:1px solid #CCC;
  3.     margin-bottom:25px;
  4.     width:600px;
  5.     padding:10px;
  6.     font-size:10px;
  7.      color:#000;
  8.     background-color:#EEE;
  9. }
  10. div#mainT input.submitT{
  11.     /*margin:0 0 0 15px;*/
  12.     float:right;
  13. }
  14. div#mainT label{
  15.     width:120px;
  16.     float:left;
  17.     /*margin:0 0 0 15px;*/
  18. }
  19. div#test{
  20.     border:1px solid red;
  21. }
  22.  
Oct 5 '07 #1
4 1145
drhowarddrfine
7,435 Expert 4TB
And it should not. Parent elements are never to expand to contain floated elements. (IE will but this is a bug in IE). to get the parent to contain the content "overflowing" out of the div, add 'overflow:auto' to the containing div.
Oct 5 '07 #2
dmorand
219 100+
And it should not. Parent elements are never to expand to contain floated elements. (IE will but this is a bug in IE). to get the parent to contain the content "overflowing" out of the div, add 'overflow:auto' to the containing div.
What would be the alternative to get this to work? I was under the impression that the parent element would expand, damn.
Oct 6 '07 #3
drhowarddrfine
7,435 Expert 4TB
I already showed you.
Oct 6 '07 #4
dmorand
219 100+
I already showed you.
Ok, I just wasn't sure if there was a different way I should be doing this rather than using floats. Thanks though!
Oct 6 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Penn Markham | last post: by
2 posts views Thread by Firas D. | last post: by
4 posts views Thread by Matthew | last post: by
8 posts views Thread by Tom | last post: by
7 posts views Thread by laclac01 | last post: by
6 posts views Thread by Justin | last post: by
5 posts views Thread by Sanjay Kulkarni | last post: by
16 posts views Thread by luca bertini | last post: by
2 posts views Thread by XIAOLAOHU | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.