On a web page, I have two divs. I would like to place the second div just right to the other one so that they’re in a line.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
floatCSS style. Set it toleftfor the first div. The second div will be placed just right of it (so long as there is enough space)Note, that sometimes it may be necessary to give the floating divs a fixed width in order to achieve the proper horizontal layout.