CSS Centered Testimonial
A centered testimonial with the avatar sitting on the top edge, a large quote and name with company below.
We replaced three internal tools with this, and nobody misses them.
HTML
<figure class="tcenter">
<span class="tcenter-avatar" aria-hidden="true">EM</span>
<blockquote>We replaced three internal tools with this, and nobody misses them.</blockquote>
<figcaption>
<strong>Elena Marsh</strong>
<span>COO, Brightpath</span>
</figcaption>
</figure>
CSS
.tcenter {
width: 250px;
margin: 30px 0 0;
padding: 38px 20px 18px;
border-radius: 18px;
background: #fff;
box-shadow: 0 12px 30px -16px rgba(6, 78, 59, 0.4);
color: #064e3b;
font-family: system-ui, sans-serif;
text-align: center;
}
.tcenter-avatar {
display: grid;
place-items: center;
width: 56px;
height: 56px;
margin: -66px auto 12px;
border: 4px solid #ecfdf5;
border-radius: 50%;
background: #10b981;
color: #fff;
font-weight: 700;
}
.tcenter blockquote {
margin: 0;
font-size: 16px;
font-weight: 500;
line-height: 1.45;
}
.tcenter blockquote::before {
content: "“";
}
.tcenter blockquote::after {
content: "”";
}
.tcenter figcaption {
display: grid;
margin-top: 12px;
font-size: 13px;
}
.tcenter figcaption span {
color: #6b8f80;
}
About this CSS Centered Testimonial
This CSS Centered Testimonial is 49 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses box shadows and CSS Grid. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#fff#064e3b#ecfdf5#10b981#6b8f80
How to use this centered testimonial
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.tcenterclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.