Align Div Horizontally and Responsive in HTML5
Let’s start with the HTML code:
- <div class="main">
- <div class="first"> First Div </div>
- <div class="second"> Second Div </div>
- <div class="third"> Third Div </div>
- <div class="clear"></div>
- </div>
Here I’ve three Div’s and now I am going to apply a style to it.
- main {
- width: 100 %;
- }
- .first {
- width: 30 %;
- height: 100 px;
- background: #CCC;
- float: left;
- }
- .second {
- width: 30 %;
- height: 100 px;
- background: green;
- float: left;
- }
- .third {
- width: 30 %;
- height: 100 px;
- background: red;
- float: left;
- }
- .clear {
- clear: both;
- }

Saranya RajendranPosted Jan 4, 2016, 9:25 AM
Glad to know that you liked it . thanks for the support.
Santhakumar MunuswamyPosted Dec 31, 2015, 1:48 AM
Thanks for nice share