Asked • 04/23/19

How to align 3 divs (left/center/right) inside another div?

I want to have 3 divs aligned inside a container div, something like this: [[LEFT] [CENTER] [RIGHT]]Container div is 100% wide (no set width), and center div should remain in center after resizing the container.So I set:<!-- language: lang-css --> #container{width:100%;} #left{float:left;width:100px;} #right{float:right;width:100px;} #center{margin:0 auto;width:100px;}But it becomes: [[LEFT] [CENTER] ] [RIGHT]Any tips?

1 Expert Answer

By:

Derek S. answered • 04/24/19

Tutor
New to Wyzant

Full time Web Developer, Part time Game Designer

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.