<article class="card">
<header class="card__header">
<img class="card__avatar" src="https://raw.githubusercontent.com/francescovetere/testimonial-grid-section/main/images/image-daniel.jpg" alt="photo avatar" />
<span class="card__name">Daniel Clifford</span>
<span class="card__role">Verified Graduate</span>
</header>
<p class="card__summary">
I received a job offer mid-course, and the subjects I learned were
current, if not more so, in the company I joined. I honestly feel I
got every penny’s worth.
</p>
<p class="card__description">
“ I was an EMT for many years before I joined the bootcamp. I’ve been
looking to make a transition and have heard some people who had an
amazing experience here. I signed up for the free intro course and
found it incredibly fun! I enrolled shortly thereafter. The next 12
weeks was the best - and most grueling - time of my life. Since
completing the course, I’ve successfully switched careers, working as
a Software Engineer at a VR startup. ”
</p>
</article>
@import url("https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:wght@500;600&display=swap");
/* https://piccalil.li/blog/a-modern-css-reset */
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
list-style: none;
}
/* Set core root defaults */
html:focus-within {
scroll-behavior: smooth;
}
/* Set core body defaults */
body {
min-height: 100vh;
text-rendering: optimizeSpeed;
line-height: 1.5;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
}
/* Make images easier to work with */
img,
picture {
max-width: 100%;
display: block;
}
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
/* custom props */
:root {
/* typography */
--ff-primary: "Barlow Semi Condensed", sans-serif;
--fw-500: 500;
--fw-600: 600;
--fs-300: 0.9rem;
--fs-400: 1rem;
--fs-500: 1.5rem;
/* colors */
--clr-light-violet: hsl(263, 55%, 65%);
--clr-moderate-violet: hsl(263, 55%, 52%);
--clr-dark-grayish-blue: hsl(217, 19%, 35%);
--clr-dark-blackish-blue: hsl(219, 29%, 14%);
--clr-white: hsl(0, 0%, 100%);
--clr-light-gray-100: hsl(0, 0%, 92%);
--clr-light-gray: hsl(0, 0%, 81%);
--clr-light-grayish-blue: hsl(210, 46%, 95%);
}
body {
display: grid;
place-items: center;
background-color: var(--clr-light-gray-100);
font-family: var(--ff-primary);
}
/** card typography **/
.card__name,
.card__summary {
font-weight: var(--fw-600);
}
.card__role,
.card__description {
font-weight: var(--fw-500);
}
.card__name,
.card__description {
font-size: var(--fs-400);
}
.card__role {
font-size: var(--fs-300);
}
.card__summary {
font-size: var(--fs-500);
}
/** card colors **/
.card {
background-color: var(--clr-moderate-violet);
color: var(--clr-light-grayish-blue);
}
.card__role,
.card__description {
opacity: 0.5;
}
/** card layout **/
.card {
--card-padding: 1.5em;
--card-spacing: 1em;
--card-radius: 15px;
padding: var(--card-padding);
width: min(90%, 600px);
border-radius: var(--card-radius);
}
.card > *:not(:last-child) {
margin-bottom: var(--card-spacing);
}
.card__header {
display: grid;
grid-template-columns: auto 1fr;
grid-template-areas:
"avatar name"
"avatar role";
column-gap: 1em;
}
.card__avatar {
grid-area: avatar;
width: 50px;
height: 50px;
object-fit: cover;
border: 3px solid var(--clr-light-violet);
border-radius: 100vmax;
}
.card__name {
grid-area: name;
}
.card__role {
grid-area: role;
}
/****************************/
/****************************/
/* isolation: isolate trick */
/****************************/
/****************************/
.card {
position: relative;
isolation: isolate;
}
.card::before {
content: "";
position: absolute;
right: 2em;
z-index: -1;
width: 150px;
aspect-ratio: 1;
background-image: url(https://raw.githubusercontent.com/francescovetere/testimonial-grid-section/main/images/bg-pattern-quotation.svg);
background-repeat: no-repeat;
background-size: contain;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.