There are two processes to place two div side by side. We
can use Table tag or we can use CSS to place two div side by side. Most of the
developer use CSS. Now I am giving the code to place two div side by side.
Code:
<html>
<head>
<title>
</title>
</head>
<body>
<h1>How to place two div side by side</h1>
<div style="width:200px;">
<div
style="height:300px;background-color:red;width:100px;float:left;"></div>
<div
style="height:300px;background-color:green;width:100px;float:right;"></div>
</div>
</body>
</html>
Output:
No comments:
Post a Comment