I have a footer and I have a container for the content in the page. But the content "container" class in a div causes the footer to be applied in that container too for some reason. Here is the code:
HTML:
<section id="products" class="products py-5">
<div class="container">
<!--Section Title-->
<div class="row">
<div class="col-10 mx-auto col-sm-6 text-center">
<h1 class="text-capitalize product-title" id="promosyonHeader">
Promosyon Ürünlerimiz
</h1>
</div>
</div>
</div>
Footer HTML:
<!--Footer-->
<footer class="footer mt-5">
<div class="text-center py-5 border-top border-secondary">
<h2 class="py-1">Doğuhan Tanıtım</h2>
<div class="mx-auto heading-line"></div>
</div>
<div class="container">
<div class="container">
<div id="footer" class="row mb-0">
<div class="col-lg-8 offset-lg-2 text-center">
<p>İskitler/Ankara</p>
<p>number</p>
<p>com.tr</p>
<div class="justify-content-center">
<i class="fab fa-facebook fa-2x"></i>
<i class="fab fa-twitter fa-2x"></i>
<i class="fab fa-instagram fa-2x"></i>
</div>
</div>
</div>
<!--<div class="copyright text-center py-3 border-top text-light" id="tm"><p>Tanıtım ™</p></div>-->
</div>
</div>
Try this:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<section id="products" class="products py-5">
<div class="container">
<!--Section Title-->
<div class="row">
<div class="col-10 mx-auto col-sm-6 text-center">
<h1 class="text-capitalize product-title" id="promosyonHeader">
Promosyon Ürünlerimiz
</h1>
</div>
</div>
</div>
</section>
<footer class="footer mt-5">
<div class="text-center py-5 border-top border-secondary">
<h2 class="py-1">Doğuhan Tanıtım</h2>
<div class="mx-auto heading-line"></div>
</div>
<div class="container">
<div class="container">
<div id="footer" class="row mb-0">
<div class="col-lg-8 offset-lg-2 text-center">
<p>İskitler/Ankara</p>
<p>number</p>
<p>com.tr</p>
<div class="justify-content-center">
<i class="fab fa-facebook fa-2x"></i>
<i class="fab fa-twitter fa-2x"></i>
<i class="fab fa-instagram fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
</footer>
I think there is problem with your bootstrap version. or you forgot closing some tags
Related
I have a problem with the Carousel (Bootstrap 5). The standard indicators work. I also have linked above the carousel. The link to the carousel's items works. Unfortunately, changing the class="active" does not work. I also tried various jQuery functions on this page.
The class active only works if you click on the next one but not the previous one. Then the active class just moves on to the next one and not back.
Code Snippet:
var myCarousel = $("#singles");
var myNav = myCarousel.prev();
myNav.find(".li > a").click(function() {
var newIndex = $(this).parent().index();
myCarousel.carousel(newIndex);
});
myCarousel.on("slide.bs.carousel", function() {
var newIndex = $(this).find(".carousel-inner>.active").index();
var newLI = myNav.children().eq(newIndex);
if (!newLI.hasClass("active")) {
myNav.find("li.active").removeClass("active");
newLI.addClass("active");
}
});
$(document).ready(function() {
$("#singles").on("slide.bs.carousel", function() {
$holder = $(".carousel-indicators-title .active");
$holder.next("a").addClass("active");
if ($holder.is(":last-child")) {
$holder.removeClass("active");
$(".carousel-indicators-title a:first").addClass("active");
}
$holder.removeClass("active");
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />
<!--SINGLES START-->
<section class="section-singles">
<div class="container">
<div class="singles">
<div class="singles-headline">
<h1>SINGLES</h1>
</div>
<div id="singles" class="carousel carousel-dark slide" data-bs-ride="carousel">
<div class="carousel-indicators-title">
<div class="links-singles">
<div class="links-singles-list">
Auf gehts, ab gehts
Atmen
</div>
</div>
</div>
<div class="carousel-indicators">
<button type="button" data-bs-target="#singles" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Auf gehts, ab gehts"></button>
<button type="button" data-bs-target="#singles" data-bs-slide-to="1" aria-label="Atmen"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row">
<div class="col-md-6 col-sm-6">
<div class="release-single-image">
<img src="/assets/images/singles/2022_12_Auf_gehts_ab_gehts.png" alt="Auf gehts, ab gehts - dan3er">
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="release-single-description">
<div class="release-single-description-releasedate">
<p class="releasedate-date">VÖ: 21.12.2022</p>
<p class="releasedate-single-description"><span class="single-title-description">Auf gehts, ab gehts</span></p>
<p class="releasedate-single-description">(prod. by TrapNinjaBoy)</p>
<div class="row button-padding">
<div class="col-xs-12 col-sm-12 col-md-6 d-flex align-items-center justify-content-center">
<div class="buttons button-left">
<a href="https://open.spotify.com/track/07BQNOiMSeSHkOncnI0rQy?si=59b1fddb5a2c4e28" target="_blank">
<div class="button_buy">
<p><i class="fab fa-spotify"></i> Spotify</p>
</div>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 d-flex align-items-center justify-content-center">
<div class="buttons button-right">
<a href="https://music.amazon.de/albums/B0BQ7RLCJ2?marketplaceId=A1PA6795UKMFR9&musicTerritory=DE&ref=dm_sh_2IPLe71BZH1W7DZsXV9XoBAoA&trackAsin=B0BQ7P6D1S" target="_blank">
<div class="button_buy">
<p><i class="fab fa-amazon"></i> Amazon</p>
</div>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 d-flex align-items-center justify-content-center">
<div class="buttons button-left">
<a href="https://www.youtube.com/watch?v=UVJDV-8gz9s" target="_blank">
<div class="button_buy">
<p><i class="fab fa-youtube"></i> YouTube</p>
</div>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 d-flex align-items-center justify-content-center">
<div class="buttons button-right">
<a href="https://music.apple.com/us/album/auf-gehts-ab-gehts/1660091129?i=1660091130" target="_blank">
<div class="button_buy">
<p><i class="fab fa-apple"></i> Apple Music</p>
</div>
</a>
</div>
</div>
<div class="release-vorschau">
<div class="buttons">
<a href="#" target="_blank">
<div class="vorschau">
<iframe style="border-radius:12px" src="https://open.spotify.com/embed/track/07BQNOiMSeSHkOncnI0rQy?utm_source=generator" width="100%" height="152" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-md-6 col-sm-6">
<div class="release-single-image">
<img src="/assets/images/singles/2022_11_Atmen.png" alt="Atmen - dan3er">
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="release-single-description">
<div class="release-single-description-releasedate">
<p class="releasedate-date">VÖ: 15.11.2022</p>
<p class="releasedate-single-description"><span class="single-title-description">Atmen</span></p>
<p class="releasedate-single-description">(prod. by 7Ventus)</p>
<div class="row button-padding">
<div class="col-xs-12 col-sm-12 col-md-6 d-flex align-items-center justify-content-center">
<div class="buttons button-left">
<a href="https://open.spotify.com/track/7EILfdyUR56gLXvGznN5Dj?si=93a63262f54947c7" target="_blank">
<div class="button_buy">
<p><i class="fab fa-spotify"></i> Spotify</p>
</div>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 d-flex align-items-center justify-content-center">
<div class="buttons button-right">
<a href="https://music.amazon.de/albums/B0BM9QS96K?marketplaceId=A1PA6795UKMFR9&musicTerritory=DE&ref=dm_sh_pXrsR018TIJcTlBuIiGhTN4z8&trackAsin=B0BM9N44B9" target="_blank">
<div class="button_buy">
<p><i class="fab fa-amazon"></i> Amazon</p>
</div>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 d-flex align-items-center justify-content-center">
<div class="buttons button-left">
<a href="https://www.youtube.com/watch?v=SZERRNXNeGs" target="_blank">
<div class="button_buy">
<p><i class="fab fa-youtube"></i> YouTube</p>
</div>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 d-flex align-items-center justify-content-center">
<div class="buttons button-right">
<a href="https://music.apple.com/us/album/atmen-radio-edit-single/1654253315" target="_blank">
<div class="button_buy">
<p><i class="fab fa-apple"></i> Apple Music</p>
</div>
</a>
</div>
</div>
<div class="release-vorschau">
<div class="buttons">
<a href="#" target="_blank">
<div class="vorschau">
<iframe style="border-radius:12px" src="https://open.spotify.com/embed/track/7EILfdyUR56gLXvGznN5Dj?utm_source=generator" width="100%" height="152" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!--SINGLES END-->
HTML
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-2"></div>
<div class="col-2 Jumbooptions" id="create" onclick="location.href='#';">
<p class="efr">Create</p>
<i class="fas fa-plus fa-2x" id="ci"></i>
</div>
<div class="col-2 Jumbooptions" id="add" onclick="location.href='#';">
<p class="efr">Add</p>
<i class="fas fa-address-book fa-2x" id="ai"></i>
</div>
<div class="col-2 Jumbooptions" id="stats" onclick="location.href='#';">
<p class="efr">Statistics</p>
<i class="fas fa-chart-pie fa-2x" id="si"></i>
</div>
<div class="col-2 Jumbooptions" id="export" onclick="location.href='#';">
<p class="efr">Export</p>
<i class="fas fa-file-export fa-2x" id="ei"></i>
</div>
</div>
<div class="row" id="bigger">
<div class="col-2" id=""></div>
<div id="created" class="dropdown col-4">
<h2>CREATE</h2>
<p>as many sheets as you want with ease!</p>
</div>
<div id="addd" class="dropdown col-4">
</div>
<div id="statsd" class="dropdown col-4">
</div>
<div id="exportd" class="dropdown col-4">
</div>
</div>
</div>
</div>
CSS
height:70px !important;
width:700px;
margin-left:47px
}
If I make the "height" any more than 70 the rest of the row goes to the start of the jumbotron
When height is less than 70: https://gyazo.com/6601be928cb893b5355c78fbc792e694
When height is more than 70 (200): https://gyazo.com/6b6f96fa6eadcffc6db3dd427cac8d03
I'm really not sure what to do.
I'm trying to center two columns in a row in Bootstrap and no matter what offset or centering, they won't stay on same line in center of full-width column on md size or above
Tried col-md-6 offset and adding row-center and column-center classes, nothing has worked
Here's the full footer code - I want the email and tel to be on one line on larger screens and the two social icons alongside each other on the next row. It wraps nicely to display on mobile, just the larger screens I need some help with.
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<footer class="container-fluid footer-container">
<div id="footer" class="row">
<div class="col-md-12">
<div id="action" class="row">
<div class="col-md-12">
<btn class="footer-button">
BOOK NOW!</h5>
</btn>
</div>
</div>
<div id="contact-methods" class="row">
<div class="col-md-6">
<a class="send-email" href="mailto:bookings#samanthaharris.ca" target="-blank"><i class="fas fa-envelope-square" aria-hidden="true"></i>
<h5>Email Samantha</h5></a>
</div>
<div class="col-md-6">
<a class="call" href="tel:905-749-5700"><i class="fas fa-mobile-alt" aria-hidden="true"></i><h5>905-749-5700</h5></a>
</div>
</div>
<div class="row row-center">
<div class="col-md-6 col-center"><a class="insta" href="https://www.instagram.com" target="-blank"><i class="fab fa-instagram" aria-hidden="true"></i></a>
</div>
<div class="col-md-6 col-center"><a class="facebook" href="https://www.facebook.com" target="-blank"><i class="fab fa-facebook-square" aria-hidden="true"></i></a>
</div>
</div>
</div>
</div>
</footer>
Add the 'text-center' class to your rows.
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" rel="stylesheet"/>
<div id="footer" class="row">
<div class="col-md-12">
<div id="action" class="row text-center">
<div class="col-md-12">
<btn class="footer-button">
BOOK NOW!</h5>
</btn>
</div>
</div>
<div id="contact-methods" class="row text-center">
<div class="col-md-6">
<a class="send-email" href="mailto:bookings#samanthaharris.ca" target="-blank"><i class="fas fa-envelope-square" aria-hidden="true"></i>
<h5>Email Samantha</h5>
</a>
</div>
<div class="col-md-6">
<a class="call" href="tel:905-749-5700"><i class="fas fa-mobile-alt" aria-hidden="true"></i>
<h5>905-749-5700</h5>
</a>
</div>
</div>
<div class="row text-center">
<div class="col-md-6 col-center"><a class="insta" href="https://www.instagram.com" target="-blank"><i class="fab fa-instagram" aria-hidden="true"></i>
</a></div>
<div class="col-md-6 col-center"><a class="facebook" href="https://www.facebook.com" target="-blank"><i class="fab fa-facebook-square" aria-hidden="true"></i></a>
</div>
</div>
</div>
</div>
According to docs try this way:
<div class="row justify-content-center">
<div class="col-*"></div>
<div class="col-*"></div>
</div>
I have one div that is a row and inside a few more rows with two col classes each. But what is strange is the first two col-3 classes take different width than the next two col-3 classes which makes the element un-aligned one on top of another. The code is bellow
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="row p-3 w-100">
<h5 class="text-center w-100">Color Legend</h5>
<div class="row">
<div class="col-3 w-100">
<i class="far fa-circle circle px-2"></i>
</div>
<div class="col-9 w-100">
<p>Not visited topic</p>
</div>
</div>
<div class="row">
<div class="col-3 w-100">
<i class="far fa-circle circle px-2" style="color:#016fc9;"></i>
</div>
<div class="col-9">
<p>Visted topic</p>
</div>
</div>
<div class="row">
<div class="col-3">
<i class="far fa-circle circle px-2" style="color:#00bfa5"></i>
</div>
<div class="col-9">
<p>Visted topic, pop-up question <strong>successfully</strong> answered.</p>
</div>
</div>
<div class="row">
<div class="col-3">
<i class="far fa-circle circle px-2" style="color:#f44336"></i>
</div>
<div class="col-9">
<p>Visted topic, pop-up question <strong>failed</strong> after visting.</p>
</div>
</div>
</div>
Here is a screen of the result
https://i.stack.imgur.com/LRgqd.png
You are breaking the .row > .col hierarchy. Meaning col should have .row as a parent and vice versa. In your case, you have .row as parent and child, which is why you had to give .w-100. Please try the below code.
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="row p-3">
<div class="col-12">
<h5 class="text-center">Color Legend</h5>
</div>
<div class="col-12">
<div class="row">
<div class="col-3">
<i class="far fa-circle circle px-2">I</i>
</div>
<div class="col-9">
<p>Not visited topic</p>
</div>
</div>
</div>
<div class="col-12">
<div class="row">
<div class="col-3">
<i class="far fa-circle circle px-2" style="color:#016fc9;">I</i>
</div>
<div class="col-9">
<p>Visted topic</p>
</div>
</div>
</div>
<div class="col-12">
<div class="row">
<div class="col-3">
<i class="far fa-circle circle px-2" style="color:#00bfa5">I</i>
</div>
<div class="col-9">
<p>Visted topic, pop-up question <strong>successfully</strong> answered.</p>
</div>
</div>
</div>
<div class="col-12">
<div class="row">
<div class="col-3">
<i class="far fa-circle circle px-2" style="color:#f44336">I</i>
</div>
<div class="col-9">
<p>Visted topic, pop-up question <strong>failed</strong> after visting.</p>
</div>
</div>
</div>
</div>
<div class="wrapper">
<div class="container">
<div class="blocks">
<h2 style="text-align: center">Extra Information</h2>
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"><i class="fa fa-book fa-2x" aria-hidden="true"></i><br>Reference it for later</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"><i class="fa fa-commenting-o fa-2x" aria-hidden="true"></i><br>Give Feedback</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"><i class="fa fa-info fa-2x" aria-hidden="true"></i><br>Why are annotations so important?</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"><i class="fa fa-magic fa-2x" aria-hidden="true"></i><br>They say Annotation websites are for genius; well this is why you are here!</div>
<br><br><br>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"><i class="fa fa-exchange fa-2x" aria-hidden="true"></i><br>Interaction</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"><i class="fa fa-question-circle fa-2x" aria-hidden="true"></i><br>Information</div>
</div>
</div>
</div>
</div>
It looks like Image 1
How can I make it look like image 2 but with 2 columns, because mine is all stuck with eachother:
First, you can't have more than 12 col by row, so your code is wrong.
Second, please, don't use the "I'll put every class and it'll work" as suggested by my fellow, Bootstrap work on a cascade way, you just have to set on the "until the smallest screen" you want.
If you want 2 col even in xs-, then just use the col-xs-6, no need to set the sm- / md- / lg-.
And last, I don't really understand what you want, this ?
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="wrapper">
<div class="container">
<div class="blocks">
<h2 style="text-align: center">Extra Information</h2>
<div class="row">
<div class="col-xs-6"><i class="fa fa-book fa-2x" aria-hidden="true"></i><br>Reference it for later</div>
<div class="col-xs-6"><i class="fa fa-commenting-o fa-2x" aria-hidden="true"></i><br>Give Feedback</div>
</div>
<div class="row">
<div class="col-xs-6"><i class="fa fa-info fa-2x" aria-hidden="true"></i><br>Why are annotations so important?</div>
<div class="col-xs-6"><i class="fa fa-magic fa-2x" aria-hidden="true"></i><br>They say Annotation websites are for genius; well this is why you are here!</div>
</div>
<div class="row">
<div class="col-xs-6"><i class="fa fa-exchange fa-2x" aria-hidden="true"></i><br>Interaction</div>
<div class="col-xs-6"><i class="fa fa-2x" aria-hidden="true"></i><br></div>
</div>
</div>
</div>
</div>
In bootstrap, .col-md- class is used for medium screens, .col-xs- means extra small and col-sm for small screens
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="wrapper">
<div class="container">
<div class="blocks">
<h2 style="text-align: center">Extra Information</h2>
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6">
<i class="fa fa-book fa-2x" aria-hidden="true"></i><br>Reference it for later
<br>
<i class="fa fa-commenting-o fa-2x" aria-hidden="true"></i><br>Give Feedback
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<i class="fa fa-info fa-2x" aria-hidden="true"></i><br>Why are annotations so important?
<br>
<i class="fa fa-magic fa-2x" aria-hidden="true"></i><br>They say Annotation websites are for genius; well this is why you are here!
</div>
</div>
</div>
</div>
</div>