Skip to content

Instantly share code, notes, and snippets.

@joabj
Created December 14, 2025 04:14
Show Gist options
  • Select an option

  • Save joabj/0505a0535d364cc6fa7032141f76d2a0 to your computer and use it in GitHub Desktop.

Select an option

Save joabj/0505a0535d364cc6fa7032141f76d2a0 to your computer and use it in GitHub Desktop.
From the tutorial "Center a Div"
<html>
<head>
<link rel="stylesheet" href="styles.css">
<style>
.container {width: 90%;}
.left {
width: 44%;
float: left;
background-color: red;
}
.right {
width: 44%;
float: right;
background-color: orange;
}
.clearfix {
clear: both;
}
</style>
</head>
<body>
<div class="container">
<div class="left">
<h2>First Column</h2>
<p>
Chicken
</p>
</div>
<div class="right">
<h2>Second Column</h2>
<p>
Waffles
</p>
</div>
<div class="clearfix"></div>
</div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment