How to make the text section in the center of a w3-col?

144 Views Asked by At

using w3css, cannot make "Wish you a happy day" in the center of the sand-colored section yet.

<html>
<head>
<title>W3.CSS Template</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Trirong">
<style>
body,h1,h2,h3,h4,h5 {font-family: "Trirong", serif}
</style>
</head>
<body class="w3-light-grey">

<!-- w3-content defines a container for fixed size centered content, 
and is wrapped around the whole page content, except for the footer in this example -->
<div class="w3-content" style="max-width:1100px">

<!-- Header -->
<header class="w3-container w3-center w3-padding-32"> 
  <p><button class="w3-button w3-padding-large w3-white w3-border">Welcome</button></p>
</header>

<!-- Grid -->
<div class="w3-row w3-card-4 w3-margin w3-sand">

  <!-- Blog entries -->
  <div class="w3-col l8 s12">
      <img src="../static/images/101.jpg" alt="Nature" style="width:100%">
  </div>


  <div class="w3-col l4">
        <div class="w3-container w3-sand">
        <div class="w3-container w3-sand w3-center" style="width:80%; margin:auto;">
          <p>
            <h7>WELCOME</h7>
            <h3><b>Wish you a happy day</b></h3>
            <h6>Keep calm and carry on !</h6>
          </p>
      </div>
      </div>
  </div>

<!-- END GRID -->
</div>
<br>

<!-- END w3-content -->
</div>


</body>
</html>

[![enter image description here][1]][1]

Any suggestions ?

1

There are 1 best solutions below

0
On

ok i used w3-cell and we-cell-row, not w3-container, it's working now

see this sample https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_layout_align_all