Having trouble with the rounded-circle class in Bootstrap 5?

@import url('https://myfonts.com/css?family=Roboto&display=swap');
body {
    background: #f1f2fa;
    font-family: 'Roboto', sans-serif;
}

hr {
    border: 2px solid #0b5ed7
}

.crd {
    background: #f1f2fa;
    transition: all;
}

.crd:hover {
    background: #0b5ed7;
    color: #fff;
    transition: 0.3s;
}

.card img {
    margin: auto;
}
<!doctype html>
<html lang="en">

  <head>
    <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Welcome to Your Website</title>

<meta name="description" content="Create an amazing description for your site here." />

<link rel="stylesheet" href="/css/styles.css" />
<link href="https://cdn.example.com/bootstrap.css" rel="stylesheet">
<script src="https://cdn.example.com/bootstrap.js"></script>
<script src="/js/scripts.js" defer></script>
  </head>

  <body>
    <!-- CLIENTS SECTION START -->
<section class="bg-dark text-center">
    <div class="container">
      <div class="row text-white py-5">
        <h2 class="display-6">Join Our Community Today!</h2>
        <div class="col-12">
          <div class="carousel slide" data-bs-ride="carousel">
            <div class="carousel-inner">
              <div class="carousel-item active">
                <div class="row">
                  <div class="col-lg-4">
                    <div class="card bg-light text-dark">
                      <img src="./images/profile.jpg" class="img-fluid rounded-circle mt-4" />
                      <div class="card-body">
                        <p class="lead text-center text-muted mt-4">Alice Smith</p>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                        <p class="text-warning">
                          <i class="fas fa-star"></i>
                          <i class="fas fa-star"></i>
                          <i class="fas fa-star"></i>
                          <i class="fas fa-star"></i>
                          <i class="fas fa-star"></i>
                        </p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- CLIENTS SECTION END -->
  </body>
</html>
    

If you are experiencing trouble with applying a rounded circle around images in Bootstrap 5, ensure that the image source link and classes are correctly specified. Additionally, double-check the CSS styling for any conflicting rules that may affect the appearance.

For reference:

Current Image Look https://example.com/current-image.png

Desired Image Appearance https://example.com/desired-image.png

Code Snippets

Index.html

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Your awesome title: </title>

<meta name="description" content="Write an awesome description for your new site here. It will appear in your document head meta (for Google search results) and in your feed.xml site description." />

<link rel="stylesheet" href="/styles/main.css" />
<link href="https://cdn.jsdelivr.net/npm/example/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/example/bootstrap.bundle.min.js"></script>
<script src="/scripts/main.js" defer></script>
  </head>
  [...]

Styles.css

@import url('https://fonts.myfont.com/css?family=Roboto&display=swap');
body {
    background: #f1f2fa;
    font-family: 'Roboto', sans-serif;
}

hr {
    border: 2px solid #0b5ed7
}

.crd {
    background-color: #f1f2fa;
    transition: all 0.3s ease-in-out;
}

.crd:hover {
    background-color: #0b5ed7;
    color: white;
}

.card img {
    display: block;
    width: 50%;
    height: auto;
}

Answer №1

The image is rounded. The main distinction between your outcome and the expected result is that the sample picture features a different color scheme, whereas your image maintains the same white hue as its surrounding area.

In this specific scenario, I introduced just three additional lines to your CSS in order to emphasize the circular shape of the image.

.card img {
    width: 76px;
    aspect-ratio: 1;
    background-color: silver;
}

body {
    background: #f1f2fa;
    font-family: 'Poppins', sans-serif;
}

hr {
    border: 1.5px solid #0b5ed7
}

.crd {
    background: #f1f2fa;
    transition: all;
}

.crd:hover {
    background: #0b5ed7;
    color: #fff;
    transition: 0.5s;
}

.card img {
    margin: auto;
    width: 76px;
    aspect-ratio: 1;
    background-color: silver;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cdafa2a2b9beb9bfacbd8df8e3fee3fd">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- OUR CLIENTS SECTION START -->
<section class="bg-dark text-center">
    <div class="container">
      <div class="row text-white py-5">
        <h2 class="display-6">100's of Companies have Switched to Our Company</h2>
        <div class="col-12">
          <div class="carousel slide" data-bs-ride="carousel">
            <div class="carousel-inner">
              <div class="carousel-item active">
                <div class="row">
                  <div class="col-lg-4">
                    <div class="card bg-light text-dark">
                      <img src="./assets/favicon-Icon Only [G]_76x76.png" class="img-fluid rounded-circle mt-4" />
                      <div class="card-body">
                        <p class="lead text-center text-muted mt-4">John Doe</p>
                        <p>Sit occaecat amet aute duis occaecat irure ea. Nostrud minim aliqua esse amet. Culpa laborum voluptate culpa excepteur in in ullamco velit aliqua.
  
                        </p>
                        <p class="text-warning">
                          <i class="fa-solid fa-star fa-1x"></i>
                          <i class="fa-solid fa-star fa-1x"></i>
                          <i class="fa-solid fa-star fa-1x"></i>
                          <i class="fa-solid fa-star fa-1x"></i>
                          <i class="fa-solid fa-star fa-1x"></i>
  
                        </p>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- OUR CLIENTS SECTION CLOSE -->

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Securing PayPal's purchase forms for safe online transactions

Trying to assist someone with a donation issue, but discovered that the source code allows for editing of values in the Paypal button. When selecting 5 points worth $5, it's possible to manipulate the values in the source code of the Paypal form. How ...

What is the function of DisableOutOfProcTaskHost?

While working on a WPF application, I encountered an error that was causing some issues with building the project: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common ...

Tips for filling in the values for the options in a select dropdown menu

Currently, I am facing a strange bug related to the select element. Whenever I open the dropdown, there is always a mysterious black option at the top. This is how my HTML looks like: This particular element is part of my test controller. <select ng- ...

Using CSS to set the display property to table-cell and converting it to a

I needed a SideMenu that would match the length of the content, but for some reason, using display:table-cell caused it to display:block in both Firefox and Chrome. What could be the reason behind this inconsistency? .back-branded { background: #900; ...

Using multiple html files with ui-router's ui-view feature

Is it possible to create a complex UI using multiple HTML files with ui-view in AngularJS? I am trying to achieve a layout similar to this: I attempted to implement something on Plunker, but it seems like I'm struggling to grasp the underlying concep ...

Choosing images based on aspect ratio in CSS

I am looking to add a specific class to image elements, but only for those that are in landscape format. Is there a way to target images in my HTML with a width/height ratio greater than 1, similar to how media queries work with the "device-pixel-ratio" f ...

container that fades away, while the popup remains visible

Is it possible to fade the background of a container without affecting the pop-up form inside? I've come across some solutions, but they all seem to treat them separately. Here's what I'm trying to achieve: <div class='wrapper ...

What is the best method for assigning real-life units, such as centimeters or millimeters, to a dimension

Is there a way to set the height of an img in millimeters, regardless of the device being used? Currently, setting the CSS rule height: 10mm; actually translates to height: 37.8px, as explained in this link: http://css-tricks.com/the-lengths-of-css/ If p ...

What is the best way to ensure a div is always scrollable?

I am currently working with Angular 4 and Bootstrap 4 (alpha 6). I have implemented ngx-infinte-scroll to fetch data from the server when the user scrolls to the top or bottom of the div. The issue I am facing is that the user can only scroll when there ar ...

stream a song with a font awesome symbol

Can an audio track be played using a font awesome icon, such as displaying the song name (mp3) with a play icon right next to it? When users click on the play icon, can the track start playing and be paused or stopped at will? The list will consist of app ...

Text box input that displays the latter portion before the initial part

Looking for assistance with showing the end of the entered text rather than the beginning in an input field. For example, the input could be "Starting portion, Ending Portion". If the input field is limited to 14 characters, instead of displaying the firs ...

Exploring Landscape Mode: Can we find an inspector within the iOS simulator?

As I work on developing a fully responsive cross-browser site, I've successfully coded the portrait mode. When making changes and modifying my CSS file, I had to scale my Chrome Browser up to match what I saw on my browser versus my iOS simulator. Now ...

There seems to be an issue with the CSS file linking properly within an Express application

Every time I run my app.js file, the index.html file is displayed. However, when I inspect the page, I notice that the CSS changes are not taking effect. Strangely, if I open the HTML file using a live server, the CSS changes are visible. Can someone exp ...

Download CSV file directly in Internet Explorer 10 by choosing to open the file instead of saving it on your device

On my server, I have a link available to download a file: <a id="downloadCSVFile" runat="server" href="javascript:void(0)" onclick="parent.document.location = 'CSVFile.csv';">Download</a> I attempted this method as well: <a id=" ...

How can I pass a value into a form within a modal in Bootstrap?

I am currently in the process of developing a university search website. When users enter a keyword, it will return results and display them in cards. Each card will have an 'Add review' button. Upon clicking this button, a modal will pop up cont ...

Is there a way to use JavaScript to convert HTML code into plain text?

I am looking to convert an input from an API in the following format: <p>Communication that doesn&#8217;t take a chance doesn&#8217;t stand a chance.</p> into something like this "Communication that doesn’t take a chance do ...

No data being fetched through Ajax

I am facing an issue with retrieving PHP data in the form of an array. I have created an AJAX query to display data in two divs: one is a drop-down and the second is where all data will be shown. However, the problem is that when I attempt to do this, all ...

Varied elevations dependent on specific screen dimensions

There seems to be a minor issue with the height of the portfolio container divs at specific window widths. The problematic widths range from 1025 to 1041 and from 768 to 784. To visualize this, try resizing your browser window to these dimensions on the fo ...

Transforming a select dropdown from multiple selection to single selection

Trying to create a scenario where the second dropdown menu in my HTML changes based on the selection from the first dropdown. If "Multiple" is selected in the first dropdown, then the second dropdown should have the attribute multiple="multiple". If "Singl ...

Is there a way to instruct the code to select between two variables and align their values?

I have encountered a challenge while working on a unit test. The website I am testing is dynamic, causing the CSS Selector and xpath to frequently change. As a solution, I came up with the idea of using both CSS and xpath to retrieve the same text. Curren ...