The bootstrap Carousel is malfunctioning, displaying pictures in a single column

Struggling to incorporate a fullscreen carousel on my website's landing page. The carousel should display three different images sequentially, either by manual clicking or automatically sliding after a few seconds. Utilized Bootstrap's carousel plugin following their instructions precisely, but encountered an issue where the carousel displays the images in a column when scrolled. Seeking assistance to rectify this error.

Here is the code snippet:

<head>
<meta charset="UTF-8">
    <title>Carousel_selftest</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="carousel_selftest.css">
</head>

<body>
    <div id="mycarousel" class="carousel slide" data-ride="carousel">
        <ol class="carousel-indicators">
            <li data-target="#mycarousel" data-slide-to="0" class="active"></li>
            <li data-target="#mycarousel" data-slie-to="1"></li>
            <li data-target="#mycarousel" data-slie-to="2"></li>
        </ol>

    <div class="carousel-inner">
        <div class="item active">
            <img src="Mockup_Magazin.png" alt="project1" width="1680px" height="1383,53px">
        </div>

        <div class="item2">
            <img src="infografic_1.png" alt="project2" width="1680px" height="1383,53px">
        </div>

        <div class="item3">
            <img src="PEVUO01.png" alt="project3" width="1680px" height="1383,53px">
        </div>
    </div>

    <a class="left-carousel-control" href="#mycarousel" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
        <span class="sr-only">previous</span>
    </a>
    <a class="right-carousel-control" href="#mycarousel" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
        <span class="sr-only">next</span>
    </a>
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</body>
</html>

The only CSS I added:

@charset "UTF-8";
/* CSS Document */
.container
{
    display: grid;
    margin-left: 0px;
    margin-right: 0px;
}

.mycarousel
{
    width: 50%;
    height: 632px;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

Answer №1

It seems like you've tagged bootstrap-4 but used bootstrap-3 in your code!

If you're working with bootstrap-3, you can refer to this link for corrections: w3schools_bootstrap_carousel

Answer №2

Here is the code snippet:

The slideshow duration is set to 2 seconds, and it pauses on hover only.

Download the images from the source links and give it a try:

<!DOCTYPE html>
<html lang="en>

<head>
    <title>Bootstrap Example</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
    <style>
        .a {
            width: 100%;
            height: 100%;
            margin: auto;
        }
    </style>
</head>

<body>


    <div id="carouselExampleControls" class="carousel slide" data-ride="carousel" data-interval="2000" data-pause="hover" data-wrap="true">
        <div class="carousel-inner">
            <div class="carousel-item active">
                <img class="d-block a " src="image1.jpg" alt="First slide">
            </div>
            <div class="carousel-item">
                <img class="d-block a" src="image2.jpg" alt="Second slide">
            </div>
            <div class="carousel-item">
                <img class="d-block  a" src="image3.jpg" alt="Third slide">
            </div>
        </div>
    </div>
    <div class="container">
        <div class="row">
            <div class="col">
                ************sometext****************
            </div>
            <div class="col">
                ************sometext****************
            </div>
        </div>
        <div class="row">
            <div class="col">
                ************sometext****************
            </div>
            <div class="col">
                ************sometext****************
            </div>
            <div class="col">
                ************sometext****************
            </div>
        </div>
    </div>
</body>

</html>

Click here for the live demo:Live Demo

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

I'm having trouble getting jquery css to function properly in my situation

I am trying to implement a fallback for the use of calc() in my CSS using jQuery CSS: width: calc(100% - 90px); However, when I tried running the code below, it seems like the second css() function is not executing. I suspect that there might be an issu ...

Struggling to design a CSS-based five-star rating system?

I have attempted to create a 5-star rating system, but I am having trouble with the stars overlapping. Can someone please help me? Here is my code snippet: http://jsfiddle.net/m3Yw8/1/ <div id="container"> <div class="star blankstar" id="oute ...

Creating CSS for a specific class on a single webpage can be achieved by targeting that class

Here is my custom style: <style> ul { padding:0 0 0 0; margin:0 0 0 0; } ul li { list-style:none; margin-bottom:25px; } ul li img { cursor: poin ...

Initiate an AJAX call using a GET request

Learning AJAX has been a bit challenging for me from the start. I went ahead and set up a database with a table called users, consisting of fields like id, name, email. Afterward, I created a php file named db.php to establish a connection with the dat ...

Tips for concealing the currently playing track title on a media player

I'm looking for a way to conceal the track title displayed in the media player on Internet Explorer. Here's the code I currently have: <object id="mediaPlayer" width="320" height="240" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type ...

What is the best way to dynamically alter HTML elements on my webpage?

I have a selection of radio buttons on my webpage: <form ...> <input type="radio" name="people" checked> Member <input type="radio" name="people"> Manager <input type="radio" name="people"> Supervisor <!-- Here is t ...

What is the best way to divide the results of an array into two separate slides

I have a challenge where I need to split an array with over 50 entries into multiple slides, displaying only 14 entries per slide. I've attempted the following code: <div class="mySlides fade"> <div class='content'> ...

retrieving the selected checkbox value

My challenge is to extract the values of dynamically changing checked checkBoxes on my webpage. For example: while ($row=myqli_fetch_array($result)){ echo"<div>"; echo"<select id=\"course\" onchange=getCheckBox()> <opt ...

Retrieve the variable from JavaScript and pass it to the controller

I am trying to pass a variable from a JavaScript function to my controller. Below is the AJAX function I am using: <script> $('#spielAuswahl').on('change', function(e){ console.log(e); var spielID = e.target. ...

Submit form data to MongoDB upon submission

In my node express setup, I have integrated functionality to store values entered in checkboxes and text areas into a MongoDB database. Initially, users could calculate a score by clicking a button associated with checkboxes, and then post the information ...

Issue with Table Element's Full Width Within Parent Element

Here is a demonstration of the scenario in JSFiddle I have made updates to the JSFiddle demonstration here: http://jsfiddle.net/x11joex11/r5spu85z/8/. This version provides more detailed insight into how the sticky footer functions well, albeit with a hei ...

Error: The function "validate" is not recognized (jQuery validation)

Whenever I try to run the script, I encounter this error that prevents it from working properly. An error occured: Uncaught ReferenceError: validate is not defined I attempted to call the function onsubmit from the tag and even experimented with placi ...

Adjusting the height of the navbar items to align with the size of the

In the bootstrap navbar below, I am trying to enlarge the search field to be large using 'input-lg', but this causes the other items in the navbar not to vertically center correctly. How can I align the other items in the navbar with the large in ...

Close the Bootstrap burger menu after clicking on a scrollspy link

Is there a way to automatically collapse the Bootstrap burger menu when clicking on a scrollspy link? While browsing my website on a mobile device, the Bootstrap navigation menu switches to a burger icon. However, when you click on an internal link that l ...

Display a single alert box upon entering a webpage

Can anyone help me figure out how to make an alert box appear only once when a page is initially opened, rather than every time the page reloads? For example, I want the alert to show up on the first visit, but not on subsequent visits if the page is reloa ...

Assign a JavaScript variable upon clicking a polygon on Mapbox

I have a MapBox map that consists of approximately 800 polygons representing census tracts, created using TileMill. The map has been integrated into an HTML page alongside a D3.js chart. A drop-down menu on the page allows users to select one of the 800 ce ...

Tips for ensuring text on an image dynamically resizes based on the browser's dimensions

Is there a way to keep text centered over an image when resizing the browser window to ensure responsiveness? I've tried positioning the text as an absolute element, but it keeps overflowing the boundaries of the image. How can I prevent this? .b ...

Unique creation of card deck using Bootstrap 4

Is there a way to create a card grid inside a container using Bootstrap 4? I'm having trouble understanding how to add text in the container if the text is within a div (card). <section class="second__offers"> <div class="container"> ...

Attempting to apply two different animations to a single element

Trying to implement two different animations, with one triggering before the other. In the Codepen and snippet below, you can observe that the initial animation rearranges the icons to their original positions upon page load. The second animation involves ...

Looking for solutions for handling sliding animations in jQuery?

I have a script that creates a sliding effect with a list of items. When you click on a list item, a box slides to the right, and clicking again will slide it back to its original position in a toggle fashion. Check out the demo here: The issue I'm ...