<section class="section-basic">
<div class="container">
<h1>Section Setup</h1>
<h2>Your content goes inside this container. <br>This container is centered.<br>Both the container and the wrapping section have flexible hight.</h2>
</div>
</section>
<br>
<section class="section-basic2">
<div class="container2">
<h1>Section Setup</h1>
<h2>Your content goes inside this container. <br>This container is centered.<br>Both the container and the wrapping section have flexible hight.</h2>
</div>
</section>
<br>
<section class="section-3-columns">
<div class="column">
<h1>Section Setup</h1>
<h2>Your content goes inside this container. <br>This container is centered.<br>Both the container and the wrapping section have flexible hight.</h2>
</div>
<div class="column">
<h1>Section Setup</h1>
</div>
<div class="column">
<h1>Section Setup</h1>
<h2>Your content goes inside this container. <br>This container is centered.<br>Both the container and the wrapping section have flexible hight.</h2>
</div>
</section>
CSS
.section-basic {
width: 100%;
height: auto;
display: flex;
justify-content: center;
align-content: center;
align-items: center;
text-align: left;
background: darkgrey;
}
.container {
width: 90%;
max-width: 1000px;
margin: 100px auto;
background: lightgrey;
}
.section-basic2 {
width: 100%;
height: auto;
box-sizing: border-box;
padding: 100px 0;
background: darkgrey;
}
.container2 {
width: 90%;
max-width: 1000px;
margin: 0 auto;
background: lightgrey;
}
.section-3-columns {
width: 100%;
height: auto;
display: flex;
justify-content: center;
align-items: center;
text-align: left;
padding: 100px 0;
background: darkgrey;
}
/* Set up the css for the columns */
.column {
flex: 1; /* Makes each column take up an equal amount of space, resulting in three columns */
max-width: 400px; /* Sets a maximum width for each column */
margin: 0 10px; /* Adds some horizontal margin to each column */
padding: 15px; /* Adds some padding inside each column */
background: lightgrey;
}
/*........... IRRELEVANT .............*/
html {
font-family: sans-serif;
}
h1, h2 { margin:0; padding; 0;}
h1 {font-size: 50px;}
h2 {font-size: 25px;}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.