<div style="clear:both;"></div>

In the example below is '<div style="clear:both;"></div>' the only way to make sure that everyting within the form is displayed within the form?

<div style="width:550px; margin:10px auto;">
  <form action="" style="padding:10px; border:3px solid; border-color: #36C; background-color: #EAF7FF;">
  <legend style="font-family:Arial, Helvetica, sans-serif; font-size: 21px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dotted; border-bottom-color: #FFF; display: block; line-height: 16px; color: #003;">Lorem ipsum dolor sit ame</legend>
    <label for="email" style="width:230px; display:block; float: left; font-family: Arial, Helvetica, sans-serif; color: #36C; font-size: 13px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ultricies egestas magna non cursus.</label>
<div style="float:right; width: 280px; clear: right; text-align: right; padding: 5px; background-color: #006;"><input type="text" id="email" name="email" value="email" style="width:238px; /* [disabled]height: 40px; */ line-height: 40px; padding: 10px; border: 1px solid; font-size: 13px; border-color: #36C; border-radius: 3px 0px 0px 3px; color: #555;"/><input type="button" value="GO" style="width:40px; /* [disabled]height: 40px; */ line-height: 40px; padding: 10px; border: 0; font-size: 13px; font-weight: bold; color: #FFF; background-color: #3366CC;"/></div>
<div style="clear:both;"></div>
  </form>
</div>

Open in new window


Thanks
garethtnashAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jej07Commented:
It's not the only way, there are several other options you could explore. For example, adding a min-height to your form might achieve a similar effect. But, it's working so I'm curious as to why your exploring different options.
0
LZ1Commented:
We would really need to see much more code. A live link to the working code would be the best way to debug.
0
GaryCommented:
You can remove the clear div and add overflow:auto to your container.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

COBOLdinosaurCommented:
That is a horrible way to layout a form. You should be using a fieldset, and the styling belongs in a stylesheet; not inline. That is just a maintenance nightmare waiting to happen.

Cd&
0
lightspeedvtCommented:
Agree with GaryC123, but I would add "overflow:hidden" to the <form>. Here is demo:
http://jsfiddle.net/s2h7P/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Chris StanyonWebDevCommented:
It's the form that's collapsing (because it contains the floats), so that's the one you need to add overflow:hidden to

And listen to Cd& - move that CSS out of the HTML!
0
garethtnashAuthor Commented:
Thanks All,

Agreed Cobol, inline styles are definately not the way to go, sorry I tend to build the design using inline, make sure I'm happy and then move all the style information to the external stylesheet.

Many thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.