Lining up two Divs next to each other. Is a clear float needed????? Or maybe not with Twitter Bootstrap??


I'm working on positioning a logo and a menu on a website, and I want each DIV to be lined up with each other.

As a test (before I incorporate the logo)  I have created two test divs.  They are located on this page, on the top left side:  Box on Right and Box on Left

As you can see,  "Box on Right" and "Box on left" are currently stacked on top of each other.

I want the Box on the Right to be lined up with the box on the left,  Like thisbox-left-box-right.jpg
The html is as follows  div.module  _RightBox box1
and   div.module _LeftBox  last box2

Once we get the right and left modules working then I will adapt the solution to a menu and some text that I have waiting in the wings.

Always appreciate the CSS Expert help I get here :)

Rowby GorenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

David S.Commented:
Without more details, I'd suggest reversing their order in the HTML and giving them both "float:left".

You need to consider how wide each of these new elements will need to be and how they'll be displayed at varying viewport widths.

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
Alexandre SimõesManager / Technology SpecialistCommented:
You already have a set of correctly showing next to each other there on the right where you have the Home, Blog, About Us and Testimonials.
That's pretty much the way to do it, with a parent <ul> and one child <li> per block.
Styling them correctly and floating left the <li>'s with give you the expected result.

Just look at what you have and do the same.
Rowby GorenAuthor Commented:
Hi Kravimir (and thanks Alexandre)

The float:left worked.  The modules have been replaced with the actual modules (which I guess I should have done in the first place.

So it's working fine.  The two modules show up with the browser is narrowed to "tablet" width (or vided in a tablet).

I just need to add some more styles and probably hide this version of the Text logo in cell phone and use smaller text for that device.

So to make a long story short Kravimir's solution worked.  I'm sure ALexandre's solution would have worked fine too -- but I'm using two joomla modules to do this, so Kravimir's solution is the one 'm going with.

I'm going to give Alexandre some points since it's still helpful in other situations.



Thanks for those suggestions.  Based on my module I think float:left might be the solution.

I've replaced my temporary placeholders with the actual modules that I will be using (I guess I should have done this in the first place.

If you go back to the site:The site

You'll see A Some logo text in a div class called module _ResponsiveMenu  

Then if you narrow the browser a bit (to tablet width)  You'll see a mobile menu appear. It's in a div called
Rowby GorenAuthor Commented:
Thanks again!

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

From novice to tech pro — start learning today.