<div class="container">
<main>
<div class="image">
<img src="https://preethi-dev.github.io/Modern-Layout-26/asstes/images/Images.png" alt="trainer image" />
</div>
<div class="text">
<h1>PERSONAL TRAINER</h1>
<p>
A personal trainer is an individual who has earned a certification
that demonstrates they have achieved a level of competency for
creating and delivering safe and effective exercise programs for
apparently healthy individuals and groups or those with medical
clearance to exercise.
</p>
</div>
</main>
<footer>
<a href="/">INSTAGRAM</a>
<div class="button">
<a href="/">Book free CONSULTATION</a>
</div>
<a href="/">YOUTUBE</a>
</footer>
</div>
/* Fonts */
@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@200;300;400;500;600;700&display=swap");
/* Resets */
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
a {
text-decoration: none;
}
/* Variables */
:root {
--primary: #000000;
--secondary: #ffffff;
}
/* Base Styles */
body {
background-color: var(--secondary);
color: var(--primary);
}
.container {
min-height: 100vh;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
}
main .text {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
main .text h1 {
font-family: "Oswald";
font-style: normal;
font-weight: 700;
text-align: center;
letter-spacing: -0.04em;
text-transform: uppercase;
}
main .text p,
footer a {
font-family: "Oswald";
font-style: normal;
font-weight: 500;
font-size: 1rem;
line-height: 24px;
text-align: center;
text-transform: uppercase;
color: var(--primary);
}
footer {
display: flex;
}
footer .button {
border: 2px solid #000000;
border-radius: 100px;
padding: 12px 20px;
text-align: center;
}
/* Mobile Styles */
main {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-areas:
"image image image image"
"text text text text";
grid-auto-rows: 1fr 0.5fr;
}
main .image {
grid-area: image;
}
main .text {
grid-area: text;
}
main .text h1 {
font-size: 4rem;
line-height: 72px;
}
main .text p {
padding: 1rem;
}
footer {
flex-direction: column;
align-items: center;
gap: 1rem;
padding: 2.5rem;
}
/* Small Tablet styles */
@media screen and (min-width: 500px) {
main {
grid-template-columns: repeat(6, 1fr);
grid-template-areas:
"image image image image image image"
"..... text text text text .....";
}
main .text h1 {
font-size: 5rem;
line-height: 96px;
}
footer {
flex-direction: row;
gap: 0;
justify-content: space-between;
}
}
/* Large Tablet styles */
@media screen and (min-width: 690px) {
main {
grid-template-columns: repeat(8, 1fr);
grid-template-areas:
"image image image image image image image image"
"..... text text text text text text .....";
}
main .text h1 {
font-size: 7rem;
}
}
/* laptop styles */
@media screen and (min-width: 1000px) {
main {
grid-template-columns: repeat(12, 1fr);
grid-template-areas:
"image image image image image image image image image image image image"
"..... text text text text text text text text text text .....";
}
main .text h1 {
font-size: 9rem;
line-height: 213px;
}
main .text p {
max-width: 800px;
padding: 0;
}
footer {
padding: 4.5rem;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.