grid-auto-flow: column;grid-column-startgrid-column-endgrid-row-startgrid-row-end.item {
/* start at column line 1 */
grid-column-start: 1;
/* end at column line 4 */
grid-column-end: 4;
/*start at row line 2 */
grid-row-start: 2;
/* end at row line 4 */
grid-row-end: 4;
}
grid-column
grid-column-start /
grid-column-endgrid-row
grid-row-start /
grid-row-end.item {
grid-column-start: 1;
grid-column-end: 4;
grid-row-start: 2;
grid-row-end: 4;
}
=
.item {
grid-column: 1 / 4;
grid-row: 2 / 4;
}
grid-template-areasgrid-template-areas.container {
display: grid;
grid-template-columns:
repeat(4,1fr);
grid-template-areas:
"h h h h"
"s c c c"
"s f f f";
}
header {
grid-area: h;
}
.sidebar {
grid-area: s;
}
.content {
grid-area: c;
}
footer {
grid-area: f;
}
grid-template-areas. (period) is for empty cellalign-self and align-itemsjustify-items and justify-selfsubgrid
display: grid“Create a layout that can respond to any device being used”
meta element for
viewport<meta name="viewport"
content="width=device-width, initial-scale=1">
<head> ... </head>meta element for viewport?meta element for
viewport<meta name="viewport"
content="width=device-width, initial-scale=1">
Prevents the default scaling
meta element for
viewport<meta name="viewport"
content="width=device-width, initial-scale=1">
width=device-width
initial-scale=1
meta element for
viewportmeta
tagimg {
max-inline-size: 100%;
}
Should be contained within their container
img {
/* Contained within the parent */
max-inline-size: 100%;
/* aspect ratio is maintained */
block-size: auto;
/* crop the image if needed to
preserve aspect ratio */
object-fit: cover;
/* How to crop (i.e., where is the
most important part) */
object-position: top center;
}
srcset@media type and (feature)
body {
color: black;
background-color: grey;
}
@media print {
body {
background-color: transparent;
}
}
Transparent background when printing
@media (orientation: landscape) {
/* Styles for landscape mode. */
}
@media (orientation: portrait) {
/* Styles for portrait mode. */
}
@media screen and (orientation: landscape) {
body::after {
content: "Landscape";
}
}
@media screen and (orientation: portrait) {
body::after {
content: "Portrait";
}
}
min-width@media (min-width: 400px) {
/* Styles for viewports wider than 400 pixels. */
}
<=@media (width <= 400px) {
/* Styles for viewports narrower than 400 pixels. */
}
and@media (min-width: 50em) and (max-width: 60em) {
/* Styles for viewports
wider than 50em
and narrower than 60em. /*
}
@media (50em <= width <=60em) {
/* Styles for viewports
wider than 50em
and narrower than 60em. */
}
or and not@media not ((width >= 30em) or (orientation: landscape)) {
/* These styles won't be shown
if the viewport is wider than 30em,
or if the orientation is landscape. */
.navlist {
flex-direction: column;
}
}
article background to be #F2665E
media query?min-width (using unset)flex: 1 (flexible sizing)
media query?{
"short_name": "CT",
"start_url": "/",
"icons": [
{
"src": "icon-512.png",
"sizes": "512x512"
}
],
"display": "standalone"
}

Install the PWA in Chrome




You can install using Safari and Edge as well
Open Activity 09 in VS Code
Copy the URL from Live Preview
Edge uses similar steps to Chrome

File –> Add to Dock
<link rel="manifest" href="manifest.json" />
Each page must link to a manifest file
name or short_namestart_urldisplaylocalhost (or 127.0.0.1)index.html directly in Chrome, it won’t be
installable