I have created two HTML form elements, I need them to be placed in the same line but one fro开发者_StackOverflow中文版m is placed below the other.
How can I solve this problem? What CSS i have to apply?
Apply the style display:inline
to the forms. Forms are block level elements by default and so need to be set to inline. Alternatively you could float the forms.
Forms are block by default and block automatically take 100% of the width available and are pushed one under the other. Inline element simply add next to each other following the flow of the page.
This article is very well written. It might help you a lot. Here is what you can try to force the form in the page to show as inline element :
form { dispaly:inline; }
if it is two text boxes in a seperate \div\
then write like this
div.el{display:inline;}
Then apply the class="el"
in each \div\
For simplify the code you can write the css property to \input\ element also.
精彩评论