Section CSS Setup

by davidxmartins

HTML

<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;}