Tailwind CSS Q&A Logo
Tailwind CSS Q&A Part of the Q&A Network
Q&A Logo

How do I create rounded images with borders using Tailwind CSS?

Asked on Sep 13, 2025

Answer

To create rounded images with borders using Tailwind CSS, you can use the `rounded-full` class for fully rounded images and `border` classes to add a border. Here's a simple example demonstrating how to achieve this.
<!-- BEGIN COPY / PASTE -->
    <img src="path-to-image.jpg" alt="Rounded Image" class="rounded-full border-4 border-gray-300">
    <!-- END COPY / PASTE -->
Additional Comment:
  • The `rounded-full` class makes the image circular, assuming it is a square.
  • The `border-4` class sets the border width, and `border-gray-300` sets the border color.
  • Ensure your image is square to maintain a perfect circle; otherwise, it will be an oval.
  • You can adjust the border color and width using different Tailwind border classes.
✅ Answered with Tailwind CSS best practices.

← Back to All Questions
The Q&A Network