Testimonials Grid Section con Bootstrap 5
Aprende Bootstrap construyendo este proyecto real paso a paso y desde cero.
¡Hola, desarrolladores! Hoy aprenderé a construir este hermoso proyecto diseñado por Frontend Mentor, usando el framework Bootstrap en su versión más reciente.
Este proyecto es parte del desafío #100DaysOfProjects ofrecido por Frontend Club.
¡Empecemos!🚀
Paso 1: Estructura del proyecto
Usualmente uso el disco D:\workspace
para guardar mis proyectos.
/testimonials-grid-section
│
├── /images
│ └── favicon-32x32.png # Logo o imágenes utilizadas en la página
│
│
├── index.html # Página principal
│
└── README.md # Documentación del proyecto
Paso 2: Estructura básica
En el archivo index.html
crearé la estructura HTML y enlazaré Bootstrap 5 desde CDN.
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- etiquetas meta -->
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="Santos Romero">
<!-- favicon-->
<link rel="shortcut icon" href="images/favicon-32x32.png" type="image/x-icon" />
<title>Testimonials Grid Section</title>
<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
rel="stylesheet" />
</head>
<body>
<!-- Aquí va el contenido -->
</body>
</html>
Paso 3: Contenedor principal
Usaré un contenedor (container
) para centrar (d-flex
) y agrupar todo el contenido.
<main class="container d-flex justify-content-center align-items-center vh-100">
<!-- row -->
</main>
Paso 4: Columnas
Utilizaré una sección (row
) y lo dividiré en dos columnas, izquierda (col-lg-9
) y derecha (col-lg-3
).
<section class="row">
<!-- columna izquierda -->
<div class="col-12 col-lg-9">
<!-- row -->
</div>
<!-- columna derecha -->
<div class="col-12 col-lg-3 p-2">
<!-- tarjeta 5 -->
</div>
</section>
Paso 5: Columna izquierda
La columna izquierda contiene cuatro tarjetas, por lo que usaré una fila (row
) para distribuir los espacios uniforme.
<div class="row">
<!-- tarjeta 1 -->
</div>
Paso 5.1: Tarjeta 1
La primera tarjeta (card
) ocupará ocho (col-lg-8
) grillas de la columna izquierda.
<div class="col-12 col-lg-8 p-2">
<article class="card h-100 bg-success text-white shadow-lg border-0" >
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-daniel.jpg"
alt="Daniel"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Daniel Clifford</h4>
<p class="m-0 text-white-50">Verified Graduate</p>
</div>
</div>
<p class="h6">
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="fs-6 lh-1 text-white-50">
“ 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>
</div>
</article>
</div>
Paso 5.2: Tarjeta 2
La segunda tarjeta ocupará (card
) las cuatro (col-lg-4
) grillas restantes de la columna izquierda.
<div class="col-12 col-lg-4 p-2">
<article class="card h-100 bg-primary text-white shadow-lg border-0">
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-jonathan.jpg"
alt="Jonathan"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Jonathan Walters</h4>
<p class="m-0 text-white-50">Verified Graduate</p>
</div>
</div>
<p class="h6">The team was very supportive and kept me motivated</p>
<p class="fs-6 lh-1 text-white-50">
“ I started as a total newbie with virtually no coding skills. I now
work as a mobile engineer for a big company. This was one of the best
investments I’ve made in myself. ”
</p>
</div>
</article>
</div>
Paso 5.3: Tarjeta 3
La tercera tarjeta ocupará (card
) las cuatro (col-lg-4
) primeras grillas de la columna izquierda.
<div class="col-12 col-lg-4 p-2">
<article class="card h-100 bg-secondary shadow-lg border-0">
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-jeanette.jpg"
alt="Jeanette"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Jeanette Harmon</h4>
<p class="m-0 text-primary">Verified Graduate</p>
</div>
</div>
<p class="h6">An overall wonderful and rewarding experience</p>
<p class="fs-6 lh-1 text-primary">
“ Thank you for the wonderful experience! I now have a job I really
enjoy, and make a good living while doing something I love. ”
</p>
</div>
</article>
</div>
Paso 5.4: Tarjeta 4
La cuarta tarjeta (card
) ocupará las ocho (col-lg-8
) grillas restantes de la columna izquierda.
<div class="col-12 col-lg-8 p-2">
<article class="card h-100 bg-dark text-white shadow-lg border-0">
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-patrick.jpg"
alt="Patrick"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Patrick Abrams</h4>
<p class="m-0 text-white-50">Verified Graduate</p>
</div>
</div>
<p class="h6">
Awesome teaching support from TAs who did the bootcamp themselves.
Getting guidance from them and learning from their experiences was easy.
</p>
<p class="fs-6 lh-1 text-white-50">
“ The staff seem genuinely concerned about my progress which I find
really refreshing. The program gave me the confidence necessary to be
able to go out in the world and present myself as a capable junior
developer. The standard is above the rest. You will get the personal
attention you need from an incredible community of smart and amazing
people. ”
</p>
</div>
</article>
</div>
Paso 6: Columna derecha
La última tarjeta, ocupará las 3 grillas (col-lg-3
) restantes de la sección padre.
<div class="col-12 col-lg-3 p-2">
<article class="card h-100 bg-secondary shadow-lg border-0">
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-kira.jpg"
alt="Kira"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Kira Whittle</h4>
<p class="m-0 text-primary">Verified Graduate</p>
</div>
</div>
<p class="h6">Such a life-changing experience. Highly recommended!</p>
<p class="fs-6 lh-1 text-primary">
“ Before joining the bootcamp, I’ve never written a line of code. I
needed some structure from professionals who can help me learn
programming step by step. I was encouraged to enroll by a former student
of theirs who can only say wonderful things about the program. The
entire curriculum and staff did not disappoint. They were very hands-on
and I never had to wait long for assistance. The agile team project, in
particular, was outstanding. It took my learning to the next level in a
way that no tutorial could ever have. In fact, I’ve often referred to it
during interviews as an example of my developent experience. It
certainly helped me land a job as a full-stack developer after receiving
multiple offers. 100% recommend! ”
</p>
</div>
</article>
</div>
Paso 7: Integramos todo
Unimos todas las partes dentro del elemento <body>
.
<main class="container d-flex justify-content-center align-items-center vh-100">
<!-- row -->
<div class="row">
<!-- columna izquierda -->
<div class="col-12 col-lg-9">
<div class="row">
<!-- tarjeta 1 -->
<div class="col-12 col-lg-8 p-2">
<article class="card h-100 bg-primary text-white shadow-lg border-0">
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-daniel.jpg"
alt="Daniel"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Daniel Clifford</h4>
<p class="m-0 text-white-50">Verified Graduate</p>
</div>
</div>
<p class="h6">
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="fs-6 lh-1 text-white-50">
“ 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>
</div>
</article>
</div>
<!-- tarjeta 2 -->
<div class="col-12 col-lg-4 p-2">
<article
class="card h-100 bg-secondary text-white shadow-lg border-0"
>
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-jonathan.jpg"
alt="Jonathan"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Jonathan Walters</h4>
<p class="m-0 text-white-50">Verified Graduate</p>
</div>
</div>
<p class="h6">
The team was very supportive and kept me motivated
</p>
<p class="fs-6 lh-1 text-white-50">
“ I started as a total newbie with virtually no coding skills. I
now work as a mobile engineer for a big company. This was one of
the best investments I’ve made in myself. ”
</p>
</div>
</article>
</div>
<!-- tarjeta 3 -->
<div class="col-12 col-lg-4 p-2">
<article class="card h-100 bg-light shadow-lg border-0">
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-jeanette.jpg"
alt="Jeanette"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Jeanette Harmon</h4>
<p class="m-0">Verified Graduate</p>
</div>
</div>
<p class="h6">An overall wonderful and rewarding experience</p>
<p class="fs-6 lh-1">
“ Thank you for the wonderful experience! I now have a job I
really enjoy, and make a good living while doing something I
love. ”
</p>
</div>
</article>
</div>
<div class="col-12 col-lg-8 p-2">
<article class="card h-100 bg-dark text-white shadow-lg border-0">
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-patrick.jpg"
alt="Patrick"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Patrick Abrams</h4>
<p class="m-0 text-white-50">Verified Graduate</p>
</div>
</div>
<p class="h6">
Awesome teaching support from TAs who did the bootcamp
themselves. Getting guidance from them and learning from their
experiences was easy.
</p>
<p class="fs-6 lh-1 text-white-50">
“ The staff seem genuinely concerned about my progress which I
find really refreshing. The program gave me the confidence
necessary to be able to go out in the world and present myself
as a capable junior developer. The standard is above the rest.
You will get the personal attention you need from an incredible
community of smart and amazing people. ”
</p>
</div>
</article>
</div>
</div>
</div>
<!-- columna derecha -->
<div class="col-12 col-lg-3 p-2">
<article class="card h-100 shadow-lg border-0">
<div class="card-body">
<div class="d-flex mb-3">
<img
src="images/image-kira.jpg"
alt="Kira"
class="border border-secondary border-3 rounded-circle"
/>
<div class="ps-3">
<h4 class="m-0 h6">Kira Whittle</h4>
<p class="m-0">Verified Graduate</p>
</div>
</div>
<p class="h6">Such a life-changing experience. Highly recommended!</p>
<p class="fs-6 lh-1">
“ Before joining the bootcamp, I’ve never written a line of code. I
needed some structure from professionals who can help me learn
programming step by step. I was encouraged to enroll by a former
student of theirs who can only say wonderful things about the
program. The entire curriculum and staff did not disappoint. They
were very hands-on and I never had to wait long for assistance. The
agile team project, in particular, was outstanding. It took my
learning to the next level in a way that no tutorial could ever
have. In fact, I’ve often referred to it during interviews as an
example of my developent experience. It certainly helped me land a
job as a full-stack developer after receiving multiple offers. 100%
recommend! ”
</p>
</div>
</article>
</div>
</div>
</main>
¡Y listo!👏
Ya tenemos una página de testimonios simple, clara y elegante.
Referencias
Agradecimiento y gratitud a los siguientes recursos que me ayudaron a completar este proyecto.
Frontend Mentor - Testimonials Grid Section
Bluuweb - Curso: Fundamentos de Bootstrap 5 [ Sass incluido + Guía con códigos ]
W3Schools - Bootstrap 5 Tutorial
Puedes ver el resultado final del proyecto Testimonials Grid Section y descargar el código fuente.
Conclusión
Hoy he aprendido a construir una página de testimonios en grillas usando el framework Bootstrap mediante una CDN.
Puedo imaginar todo lo que puedo aprender si codifico un proyecto todos los días durante los próximos 100 días.
La mejor manera de aprender a programar es practicando todos los días.