Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

problem with 2 div

Featured Replies

Hello,

 

Basically i am looking for put div side by side. Can any one tell me how is it done with CSS? As we know that table is so old idea & i am not able to make columns with divs.

I end up one above & other, I never get side by side css.

 

Can any one tell me how to solve this problem?

 

Thanks in Advanced!

You have to add float: left; or float: right; to all the divs that you want side by side and then clear the floats to stop the following div moving to an incorrect position.

See itms 2b, 2c and 2d here http://www.wickham43.net/firefoxbackground.php for three ways to clear floats.

Yeah, Totally Agree with Wickham. You may follow above link. You will get better idea :)

it's easy you have to give float to one of the div's or both of them.

an easy example would be :

<div class="container" style="">
<div style="float:right;display:inline-block;background:#cee">Right</div>
<div style="float:left;background:#dee">Left</div>
</div>

 

for the second div I gave it a float left, you can give it right float if you want them to be close,and them give some padding.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.