0

I want to show the three div on same line using style display-inline block and width other than this style any css3 class is available.

Code:

<div id="1" style="display:inline-block;width:10%"> </div>
<div id="2" style="display:inline-block;width:10%"> </div>
<div id="3" style="display:inline-block;width:10%"> </div>
Mohit S
  • 13,723
  • 6
  • 34
  • 69
Santhose Kumar
  • 155
  • 3
  • 19

1 Answers1

0

not sure what you are asking, but if you want to use classes instead of inline styles and having the divs aligned, you can do it using this css:

HTML

<div id="1" class="inlineDivs"> </div>
<div id="2" class="inlineDivs"> </div>
<div id="3" class="inlineDivs"> </div>
<div class="clearfix"></div>

CSS

.inlineDivs{
  display:inline-block;
  width:33%;
  float:left;
  background:deepskyblue;
  min-height:200px;
  border-right:1px solid black;
}

Usually, after some floating divs I also use a clearfix div.

check how it looks here: http://codepen.io/anon/pen/LVvVER

Nick
  • 13,493
  • 8
  • 51
  • 98