NextIndexPrevious

Programs in CSS

3. Aligning three boxes side by side using CSS.


style.css

#box1{
	width:200px;
	height:200px;
	background-color:#09F;
	float:left;
	margin-right:20px;
}
#box2{
	width:200px;
	height:200px;
	background-color:#F96;
	float:left;
	margin-right:20px;
}
#box3{
	width:200px;
	height:200px;
	background-color:#6C6;
	float:left;
	margin-right:20px;
}

boxmodel.html

<body>

<div id="box1"></div>

<div id="box2"></div>

<div id="box3"></div>

</body>

Output :





Developed by


World Wide Web Consortium

World Wide Web Consortium

Google+