You can use this CSS code to create a three-column layout. Simply add the appropriate HTML to create the column structure in your HTML document.
Here is an example of CSS code to create a three-column layout:
.container {
display: flex;
justify-content: space-between;
}
.column {
flex-basis: 30%;
padding: 20px;
background-color: #f1f1f1;
border: 1px solid #ccc;
}
/* Optional: Adjust layout for mobile devices */
@media screen and (max-width: 768px) {
.container {
flex-direction: column;
}
.column {
flex-basis: 100%;
margin-bottom: 20px;
}
}
You can use this CSS code to create a three-column layout. Simply add the appropriate HTML to create the column structure in your HTML document.
For example, here is a simple HTML example that uses the three-column layout:
<div class="container">
<div class="column">
<h2>Column 1</h2>
<p>Content of column 1</p>
</div>
<div class="column">
<h2>Column 2</h2>
<p>Content of column 2</p>
</div>
<div class="column">
<h2>Column 3</h2>
<p>Content of column 3</p>
</div>
</div>
Make sure to link your CSS file to your HTML file using the <link> tag in your <head>.

Be the first to comment