Code Steps
16Feb/12Off

How to align <div> tags side by side?

An HTML <div>Tag is used to define a section in an HTML document. This tag is more often used to create weblayouts. Some times it is required to place two <div> tags side by side. Below are the steps to achieve this:

First, Write the HTML code fro two <div> tags.

Second, Use the HTML attribute float with proper values to align these two <div> tags side by side.

Third, Refresh the webpage, to get your changes affected.

Following is the HTML code for this:

DIV Tag 1 Code:

<div style="float: left;">DIV Tag 1</div>

DIV Tag 2 Code:

<div style="float: right;">DIV Tag 2</div>

 

 

 

By A2Z FAQS