Enhance the appearance of your webpage by utilizing the Bootstrap round-circle class along with

I am facing an issue with my Bootstrap carousel that contains multiple items.

Here is my HTML code:

<div class="carousel w-100 " data-ride="carousel" id="recipeCarousel">
   <div class="carousel-inner w-100" role="listbox">
        <div class="carousel-item active">
            <img class="d-block col-sm-12 col-md-4 rounded-circle mystyle"  src="{% static 'core/src/img/staff_member_01.jpg'%}">
            <img class="d-block col-sm-12 col-md-4 rounded-circle mystyle" src="{% static 'core/src/img/staff_member_02.jpg'%}">
            <img class="d-block col-sm-12 col-md-4 rounded-circle mystyle"  src="{% static 'core/src/img/staff_member_03.jpg'%}">
        </div>
        [...]
  </div>
</div>

This is my CSS style:

.mystyle{
 border:1px solid #d3232e;
}

However, my issue arises when I try to add padding between the images, as the border layout breaks. See the screenshot below:

https://i.sstatic.net/zDWD5.jpg

If I attempt to use margins instead of padding, like this:

.mystyle{
  margin: 0 0.4em;
  padding: 0!important;
  border:1px solid #d3232e;
}

It looks like this:

https://i.sstatic.net/3jNai.jpg

I would greatly appreciate any help or suggestions to address this issue. Thank you!

EDIT 1 I have also posted a new question to resolve the broken carousel jQuery issue after fixing the problem mentioned here.

Answer №1

For an optimal layout, it is recommended to place the images within col divisions and ensure they are responsive by utilizing img-fluid...

<div class="carousel w-100" data-ride="carousel" id="recipeCarousel">
    <div class="carousel-inner text-center w-100" role="listbox">
        <div class="carousel-item d-flex row active">
            <div class="col-sm-12 col-md-4"><img class="rounded-circle img-fluid mystyle" src="//placehold.it/300"></div>
            <div class="col-sm-12 col-md-4"><img class="rounded-circle img-fluid mystyle" src="//placehold.it/300"></div>
            <div class="col-sm-12 col-md-4"><img class="rounded-circle img-fluid mystyle" src="//placehold.it/300"></div>
        </div>
    </div>
</div>

By following this structure, you can prevent any overlap issues.

Answer №2

Enclose each image in a container.

.round-container{
  display:inline-block;
  margin:10px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>


<div class="round-container">
<img class="rounded-circle" src="https://via.placeholder.com/100x100" width="100">
</div>

<div class="round-container">
<img class="rounded-circle" src="https://via.placeholder.com/100x100" width="100">
</div>

<div class="round-container">
<img class="rounded-circle" src="https://via.placeholder.com/100x100" width="100">
</div>

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

IE is failing to trigger jAlert function

When I validate a text box by pressing the enter key on my keyboard, the validation works fine but the JAlert doesn't show up. However, when I call the same function on a button click, the alert shows in IE. I am quite confused by this behavior and wo ...

Error in content policy for CSS in Stripe Checkout

I am currently attempting to integrate Stripe Checkout into my Ionic App. I have created a Directive that injects the form into my content view, however, upon execution, the CSS fails due to a content policy violation: checkout.js:2Refused to load the s ...

Can an additional height be added to the equalizer to increase its height?

Is it feasible to append an additional 35px to the height determined by Foundation Equalizer? For instance, if Equalizer computes a height of 350px, I would like to increase it by 35px. This means that the resultant style should be height: 385px; instead ...

Troubleshooting: jQuery AJAX Post - Issue with Greater than conditional not functioning as expected

Having an issue with a conditional in my code. Everything is functioning properly except for this specific line. <if condition="$show['member']"> <script type="text/javascript" > $(function() { $("#submitbutton$post[postid]").click(f ...

Creating a Shadow Effect on CSS Triangles

I have created a unique design that resembles a large arrow pointing to the right. <div style=" font-size: 0px; line-height: 0%; width: 100px; border-bottom: 80px solid #8cb622; border-right: 62px solid #dadbdf; "></div> <div style=" font ...

Is there a way to update a div element with an image without having to refresh

Currently working on a project for my studies where I am reading the x and y coordinates from a touch pad and drawing it in real time using PHP. I have created a draw page that takes these coordinates and displays them on an image, which is then shown on ...

Displaying HTML widget in an external browser using R

Is there a way to directly display an HTML widget (such as one created by dygraphs) in an external browser like Chrome? Saving the widget, creating an HTML page, linking it to the widget, and using browseURL could be an option, but I am looking for a more ...

Effective steps after Ajax request

Whenever a user clicks the "like" button, I perform a check in the database to see if they have already liked the photo. This check is done using ajax. If the photo has already been liked, the success message will indicate "already liked", otherwise it wi ...

What could be causing the sporadic functionality of my jQuery image resizing code?

Seeking help for an issue I am facing with my jQuery code. I have been trying to scale a group of images proportionally within an image carousel using jCarousel Lite plugin. However, the resizing code seems to work randomly and I can't figure out why. ...

What is the reason border property does not transition effectively?

I am trying to remove the border property after a certain period of time (1 second) and make it smooth. Here is what I have attempted: var elem = $('div').css({'border-top':'6px solid #FC9A24', 'border-le ...

jQuery does not allow for text input values to be posted

Having an issue with a form using the POST method. I have some PHP controls that are being calculated in jQuery. While all the form control values are accessible in the next form using POST, the values added through jQuery are not posting to the next form. ...

Are Opera and IE9 blocking cross-origin Ajax requests?

I have been utilizing the following page - - to initiate a cross-origin Ajax request towards this specific resource: The functionality appears to be functioning as expected in Chrome, Safari, and Firefox, but encounters an issue in IE9 and Opera. Below ...

Building interactive web forms with real-time validation using CodeIgniter

I'm looking for a way to use ajax (jquery library) to validate my forms. Specifically, I have a form that requires a minimum password length of 6 characters. Currently, I have implemented the validation rule as follows, $this->form_validation-> ...

"Adjust the orientation of a video and ensure it properly fills the screen with CSS styling

Below is the CSS style being used: video { position: absolute; transform: rotate(90deg); width: 100%; height: 100%; z-index: 4; visibility: visible; } This code snippet demonstrates a video element: <video id="myVideo" ...

Ways to include text underneath icons using HTML and CSS

Seeking guidance on how to display text below icons on my website. Can someone please provide instructions? <div class="bottom-bar div-only-mobile" style="position: fixed; bottom: 0; width:100%"> <a href="Dashboard"> <ion-icon name= ...

The integration of HTML and CSS using ng-bind-html appears to be malfunctioning

<ion-item ng-bind-html="renderHtml(word[key])"> </ion-item> When referring to word[key], it represents: <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> This is the CSS being u ...

Out of the blue div, could you lend your assistance?

I have a code that displays 5 random images with corresponding text. My challenge is that I want to separate the text into another div so that I can add another function to it, while still keeping the images random with their corresponding text. <scr ...

Expanding a feature that modifies the CSS properties of every input element

Creating a text tracking (letter-spacing) demonstration where range sliders are used to update CSS properties. I'm looking to improve the functionality so that the labels also update dynamically, without repeating output2.textContent = this.value;. An ...

execute a C++ application within a web browser using HTML

Recently, I created a captcha program using c++ and sfml. Now, I'm interested in running this program on an HTML page. Can anyone provide guidance on how to accomplish this? ...

Global variable appears undefined in Angular 2 view, yet it is still displaying

I'm running into issues with my Angular 2 code. Inside my ts file, I have the following: import { Test } from '../../../../models/test'; import { TestService } from '../../../../services/test.service'; import { Job} fr ...