How to show multiple div sections side by side in HTML5

Manideepgoud
Posted by Manideepgoud under HTML 5 category on | Points: 40 | Views : 479
Here we are going to see how to align multiple div in a single line.
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<style>
div{
height:20px;
width:50px;
border:2px solid green;
float:left;
}
</style>
</head>
<body>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</body>
</html>

In the above code we are using
float:left;
property which is used to align div sections side by side.

Comments or Responses

Login to post response