Hi,
I need to use bootstrap to create a carousel that has some content in it. I have created the first slide and then I added the CSS bootstrap link and the js one.
After adding the bootstrap CSS link my SCSS become a mess, the content of the slide was not in the same position the text change weight and size, and margins and paddings were changed. I do have my sccs linked under the bootstrap CSS but for some reason, the bootstrap still overwrites my scss.
Also, for some reason the carousel does not work at all, I have created a second slide and it just places it under the first one. I have uses the bootstrap classes to overwrite some styles placing the slide content where I wanted but it works like in the tutorial that I have followed and the buttons (carousel controls) do not work. This is the tutorial link
This is my code from the index.html page
“`
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″ />
<meta http-equiv=”X-UA-Compatible” content=”IE=edge” />
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″ />
<!– Bootstrap CSS –>
<!– <link
href=”https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css”
rel=”stylesheet”
integrity=”sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6″
crossorigin=”anonymous”
/> –>
<link rel=”stylesheet” href=”style/style.css” />
<script defer src=”index.js”></script>
<script
src=”https://kit.fontawesome.com/6528d97294.js”
crossorigin=”anonymous”
></script>
<title>Cosmos</title>
</head>
<body>
<!– Nav bar ——————————- –>
<nav class=”nav-bar”>
<div class=”nav-logo”>
<a href=”#”>
<img src=”img/cosmos-logo.png” alt=”Cosmos Logo” />
</a>
</div>
<div class=”nav-links”>
<ul>
<button class=”close-menu-btn”><i class=”fas fa-times”></i></button>
<a href=”#”><li>Home</li></a>
<a href=”#”><li>Projects</li></a>
<a href=”#”><li>Services</li></a>
</ul>
</div>
<div class=”nav-menu-btn”>
<button class=”open-menu-btn”>
<i class=”fas fa-bars”></i>
</button>
</div>
</nav>
<!– Nav bar ——————————- –>
<!– Header ——————————- –>
<header class=”header”>
<div id=”myCarousel” class=”carousel slide” data-ride=”carousel”>
<div class=”carousel-inner”>
<div class=”carousel-item active”>
<div class=”header-image”>
<div class=”header-img-info”>
<h3>Enceladus</h3>
<p>The Saturn System</p>
<p>Distance: 95 AU</p>
<p>Population: 3920</p>
</div>
</div>
<div class=”header-card”>
<div class=”header-card-arrow”></div>
<div class=”header-card-content”>
<div class=”header-card-top”>
<h2>Enceladus</h2>
<div class=”header-card-description”>
<p>
Is the sixth-largest moon of Saturn. It is about a tenth
of Saturn’s largest moon, Titan.
</p>
<p>
Explore this amazing cosmic marvel in a safe and fast trip
with our aerospace company.
</p>
</div>
</div>
<div class=”header-card-footer”>
<div class=”card-price”>
<p>999.990 €</p>
<p>one way ticket</p>
</div>
<div class=”card-button”>
<button class=”card-buy-button”>Buy</button>
</div>
</div>
</div>
</div>
</div>
<div class=”carousel-item”>
<div class=”header-image”>
<div class=”header-img-info”>
<h3>Enceladus</h3>
<p>The Saturn System</p>
<p>Distance: 95 AU</p>
<p>Population: 3920</p>
</div>
</div>
<div class=”header-card”>
<div class=”header-card-arrow”></div>
<div class=”header-card-content”>
<div class=”header-card-top”>
<h2>Enceladus</h2>
<div class=”header-card-description”>
<p>
Is the sixth-largest moon of Saturn. It is about a tenth
of Saturn’s largest moon, Titan.
</p>
<p>
Explore this amazing cosmic marvel in a safe and fast trip
with our aerospace company.
</p>
</div>
</div>
<div class=”header-card-footer”>
<div class=”card-price”>
<p>999.990 €</p>
<p>one way ticket</p>
</div>
<div class=”card-button”>
<button class=”card-buy-button”>Buy</button>
</div>
</div>
</div>
</div>
</div>
<a
href=”#myCarousel”
class=”carousel-control-prev carousel-arrow”
role=”button”
data-slide=”prev”
>
<span class=”sr-only”>Previous</span>
<span class=”carousel-control-prev-icon” aria-hidden=”true”></span>
</a>
<a
href=”#myCarousel”
class=”carousel-control-next carousel-arrow”
role=”button”
data-slide=”next”
>
<span class=”sr-only”>Previous</span>
<span class=”carousel-control-next-icon” aria-hidden=”true”></span>
</a>
</div>
</div>
</header>
<!– Header ——————————- –>
<!– BOOTSTRAP ——————————- –>
<script
src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js”
integrity=”sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf”
crossorigin=”anonymous”
></script>
</body>
</html>