Grid layout and text centering
Hello
I have 2 questions..... more to come : )
I started with this code and modified it and I am using the W3 editor there from the first example shown. My Dreamweaver trial ended and I did not want to rent till I knew more about the grid layout.
https://www.w3schools.com/css/css_grid.asp
1) Why is the footer not even with the 'right 2' like the 'Main' and 'Right' above? - see code.
2) How to center text for say the heading then have the paragraph text below it start on
the left side?
<!DOCTYPE html>
<html>
<head>
<style>
.grid-container {
display: grid;
grid-template-areas:
'header header header header header header header'
'menu main main main right1 right1 right1'
'menu footer footer footer footer right2 right2';
grid-gap: 10px;
grid-template-rows: 90px 1fr 80px;
grid-template-columns: 20% 40% 15%;
height: 50vh;
max-width: 940px;
min-width: 300px;
color: #fff;
padding: 20px;
border-radius: 15px;
box-shadow: 1px 2px 9px 1px rgba(0, 0, 0, 0.5);
}
.header { grid-area: header;
padding: 20px;
background-color: #66CDAA;
}
.menu { grid-area: menu;
padding: 20px;
background-color: #F5DEB3;
}
.main { grid-area: main;
padding: 20px;
background-color: #FFF8DC;
}
.right1 { grid-area: right1;
padding: 20px;
background-color: #F5DEB3;
}
.footer { grid-area: footer;
padding: 20px;
background-color: #66CDAA;
}
.right2 { grid-area: right2;
padding: 20px;
background-color: #66CDAA;
}
h1 {
margin: 0px;
padding: 0px;
font-size: 180%;
color: black;
font-family: 'Georgia', 'sans-serif';
}
h2 { color: black;
font-size: 150%;
margin: 0px;
padding: 0px;
color: black
font-family: 'Georgia', 'Open Sans';
display: inline;
}
p { color: blue;
font-size: 100%;
margin: 0px;
padding: 0px;
font-family: 'Open Sans', 'sans-serif';
}
</style>
</head>
<body>
<h1>Grid Layout 3 col</h1>
<p>This grid layout contains six columns and three rows:</p>
<br><br>
<div class="grid-container">
<div class="header"><h2>Header<h/2></div>
<div class="menu"><h2>Menu</h2></div>
<div class="main"><h2>Main</h2>
<p>Grid layout six columns and three rows</p>
</div>
<div class="right1"><h2>Right</h2></div>
<div class="footer"><h2>Footer</h2></div>
<div class="right2"><h2>right 2</h2></div>
</div>
</body>
</html>
