Last Updated: February 25, 2016
·
2.179K
· karol-gontarski

How to place three DIVs in regular spacing inline.

Picture

HTML

inside <div class="modal-body">

<div id="container">
    <div id="left">A</div>
    <div id="center">B</div>
    <div id="right">C</div>
</div>

CSS

with width: 350px try with width: 100%

#container {
    width:350px;
    text-align:center;        
    margin:0 auto;
}

#left {
    float:left;
    width:100px;
    height: 100px;
    background: #888;
}

#center {
    display: inline-block;
    margin:0 auto;
    width:100px;
    height: 100px;
    background: #888;
}

#right {
    float:right;
    width:100px;
    height: 100px;
    background: #888;
}

Example

http://jsfiddle.net/dCwp3/

1 Response
Add your response

You are asking the question or showcasing your findings? I wonder if this would work. You placed any demo?

over 1 year ago ·