Why doesn't mx-auto center my div elements? (Bootstrap 5) - bootstrap-5

I try to use mx-auto to center my div elements. I used it a section before, and it does its job just fine. But in this scenario, it doesn't work.
No margin or padding added using m- or p- works.
<section id="features">
<div class="container-fluid">
<div class="row">
<div class="col-lg-4 mx-auto">
<i class="fa-solid fa-circle-check fa-6x icon-feature"></i>
<h3>Easy to use.</h3>
<p class="p-feature">So easy to use, even your dog could do it.</p>
</div>
<div class="col-lg-4 mx-auto">
<i class="fa-solid fa-bullseye fa-6x icon-feature"></i>
<h3>Elite Clientele</h3>
<p class="p-feature">We have all the dogs, the greatest dogs.</p>
</div>
<div class="col-lg-4 mx-auto">
<i class="fa-solid fa-heart fa-6x icon-feature"></i>
<h3>Guaranteed to work.</h3>
<p class="p-feature">Find the love of your dog's life or your money back.</p>
</div>
</div>
</div>
</section>

Related

The next section is below previous section

I make card wrap by container
here is my code
i make new section next to this section.. but next section is below this section..
what makes next section is below previous section, btw i am using bootstrap 5
<div class="container-fluid room">
<h2 class="room-section-title text-center"> Our Rooms</h2>
<div class="container d-flex justify-content-evenly align-items-center flex-md-column flex-lg-row flex-column ">
<div class="card mx-3">
<img src="/assets/images/room/Deluxe.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Superior Room</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk of the card's content.
</p>
<div class="btn">
<a class="text-primary text-decoration-none" href="#">Room detail</a>
</div>
</div>
</div>
<div class="card mx-3">
<img src="/assets/images/room/Deluxe.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Deluxe Room</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk of the card's content.
</p>
<div class="btn">
<a class="text-primary text-decoration-none" href="#">Room detail</a>
</div>
</div>
</div>
<div class="card mx-3">
<img src="/assets/images/room/Deluxe.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Suite Room</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk of the card's content.
</p>
<div class="btn">
<a class="text-primary text-decoration-none" href="#">Room detail</a>
</div>
</div>
</div>
</div>
</div>
You have to provide the whole file. Then only we can answer it.

How can I change the order of the parahraph and image on Boostrap 5 only on mobile?

I have tried with both order-xs-1 and order-xs-first, but none is working and i don't know why. I want on mobile the image to be first and the paragraph second.
<div class="container"> <div class="row bg-white g-0"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-6 pt-5 ps-5 "> <h2 class="fs-1 fw-light">Make It The Best</h2> <h4 class="fs-3 my-3 fw-bold">Unseen experience. Join Us !</h4> <p>A wonderful serenity has taken.</p> <button type="button" class="button px-4 py-3 me-3 mt-2 fs-5">Learn More</button> </div> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-6 "> <img src="/images/section3/drink.jpg" class="img-fluid" alt=""> </div> </div> </div>
There are a lot of things wrong with your code. I would go back and have a proper read of the way bootstrap handles breakpoints. If you have specified col-md-6 you don't need all the other col-SZ-6, as breakpoints work from a resolution UP.
As for your exact problem, it is easily fixed by putting the column first in the HTML and then letting bootstrap move it at the iPad breakpoint with order-md-last:
<div class="container">
<div class="row bg-white g-0">
<div class="col-12 col-md-6 order-md-last mb-3">
<img src="/images/section3/drink.jpg" class="img-fluid" alt="">
</div>
<div class="col-12 col-md-6">
<h1 class="h2 fs-1 fw-light">Make It The Best</h2>
<h2 class="h4 fs-3 my-3 fw-bold">Unseen experience. Join Us !</h4>
<p>A wonderful serenity has taken.</p>
<button type="button" class="button px-4 py-3 me-3 mt-2 fs-5">Learn More</button>
</div>
</div>
</div>
You should also not use H tags to style headings, either apply a H class like I have or use CSS to change the size of your headings. Heading tags should also go in order H1->H2 etc...

Put a link on the right of a card - bootstap

I have a page (show route) that looks like this:
and i would like to position the link to "All Camgrounds" to the right of the card. I tried several things like adding classes like "text-right" or "justify-content-end", but it did not work.
I am using the framework Boostrap-5.
Any help would be much appreciated. Here is the code for the SHOW page :
<% layout('layouts/boilerplate') %>
<div class="row">
<div class="col-6 offset-3">
<div class="card">
<div class="card-header">
<h2>
<%= campground.title %>
</h2>
</div>
<img src="<%= campground.image %>" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text">
<%= campground.description %>
</p>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item text-muted">
<%= campground.location %>
</li>
<li class="list-group-item">
$ <%= campground.price %> /night
</li>
</ul>
<div class="card-body">
<a class="card-link btn btn-warning" href="/campgrounds/<%= campground._id %>/edit">Edit</a>
<form class="d-inline" action="/campgrounds/<%= campground._id %>?_method=DELETE" method="post">
<button class="btn btn-danger">Delete</button>
</form>
<a class="card-link d-inline text-right" href="/campgrounds">All
campgrounds</a>
</div>
</div>
</div>
</div>
There are many different ways to align right in Bootstrap 5.
In your case it's probably easiest to use float-end.
<div class="row">
<div class="col-6 offset-3">
<div class="card">
<div class="card-header">
<h2> Title </h2>
</div>
<img src="//via.placeholder.com/500" class="card-img-top" alt="...">
<div class="card-body">
<p class="card-text"> campground.description </p>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item text-muted"> campground.location </li>
<li class="list-group-item"> $ 39/night </li>
</ul>
<div class="card-body">
<a class="card-link btn btn-warning" href="/campgrounds/<%= campground._id %>/edit">Edit</a>
<form class="d-inline" action="/campgrounds/<%= campground._id %>?_method=DELETE" method="post">
<button class="btn btn-danger">Delete</button>
</form>
<a class="card-link float-end" href="/campgrounds">All campgrounds</a>
</div>
</div>
</div>
</div>
https://codeply.com/p/S9PyKHZC9y
Also note, left and right have been replaced with start and end in Bootstrap 5.

img class="rounded-circle" is not creating a rounded circle in asp.net

I am using bootstrap in asp.net mcv application. I want the images to be rounded. therefore used the "img class="rounded-circle". The code is below.
index.html
#{
ViewBag.Title = "Home Page";
}
<h1 class="my-4">
About Us
<small>It's Nice to Meet You!</small>
</h1>
<div class="row">
<div class="col-lg-12">
<h2 class="my-4 text-center">Our Services</h2>
</div>
<div class="col-lg-4 col-sm-6 text-center mb-4">
<a href="Application/Search">
<img class="rounded-circle img-fluid d-block mx-auto" src="~/Images/search.png" alt="">
</a>
<h3>Search App</h3>
<p>What does this team member to? Keep it short! This is also a great spot for social links!</p>
</div>
<div class="col-lg-4 col-sm-6 text-center mb-4">
<a href="Application/TTS">
<img class="rounded-circle img-fluid d-block mx-auto" src="~/Images/text-to-speech.png" alt="">
</a>
<h3>Text-to-Speech</h3>
<p>What does this team member to? Keep it short! This is also a great spot for social links!</p>
</div>
<div class="col-lg-4 col-sm-6 text-center mb-4">
<a href="Application/SpeechRecognition">
<img class="rounded-circle img-fluid d-block mx-auto" src="~/Images/speech-recognition.jpg" alt="">
</a>
<h3>Speech Recognition</h3>
<p>What does this team member to? Keep it short! This is also a great spot for social links!</p>
</div>
<div class="col-lg-4 col-sm-6 text-center mb-4">
<a href="Application/VAvatar">
<img class="rounded-circle img-fluid d-block mx-auto" src="~/Images/virtual-avatar.jpg" alt="">
</a>
<h3> Virtual Avatar</h3>
<p>What does this team member to? Keep it short! This is also a great spot for social links!</p>
</div>
<div class="col-lg-4 col-sm-6 text-center mb-4">
<a href="Application/VAvatar">
<img class="rounded-circle img-fluid d-block mx-auto" src="~/Images/text-to-speech.png" alt="">
</a>
<h3>John Smith</h3>
<p>What does this team member to? Keep it short! This is also a great spot for social links!</p>
</div>
<div class="col-lg-4 col-sm-6 text-center mb-4">
<a href="Application/VAvatar">
<img class="rounded-circle img-fluid d-block mx-auto" src="~/Images/text-to-speech.png" alt="">
</a>
<h3>John Smith</h3>
<p>What does this team member to? Keep it short! This is also a great spot for social links!</p>
</div>
This is how it looks like
The above code should give a rounded image. But it is still square. Why is this?
For Bootstrap, you should add img-circle and not rounded-circle. See the sample here Give it a try.

i need help getting ratchet push.js fade transition to work?

this is a basic example calling "two.html", with the fade transition
<div class="content">
<div class="medium-6 columns text-center top">
POSPAId
</div>
</div>
and this is two.html
<div class="content">
<div class="medium-6 columns text-center top">
<a href="index.html" data-transition="slide-out">
back
</a>
</div>
</div>

Resources