Responsive Bootstrap Image Slider

I'm struggling with making my Bootstrap Carousel responsive. Below is the code I currently have:

<div id="slider" class="slider carousel slide">
<div class="carousel-inner" align="center">
<div class="item active">
<div style="display: flex;flex-direction:row; justify-content: center; align-items: center;">
<div><p style="font-family:'Aleo';color: #4e4c4a;font-size: 13vw;top:-30px;position:relative;">AR111</p><p style="font-family:'Aleo';color: #4e4c4a;font-size: 2vw;top:-80px;position:relative;">Description of the product goes here <br> about 2 lines</p></div>
<div style=""><img src="images/ar111.png" class="img-responsive"></div>
</div>
</div>
<div class="item">

</div>
<div class="item">
</div>
</div>
<a class="left carousel-control" href="#slider" data-slide="prev">
<span class="glyphicon glyphicon-circle-arrow-left"></span>
</a>
<a class="right carousel-control" href="#slider" data-slide="next">
<span class="glyphicon glyphicon-circle-arrow-right"></span>
</a>
</div>

This is the desired look of the slider on all screens.

View it live here:

However, the layout gets distorted depending on screen resolution. I attempted to use flexbox for more flexibility but it's still not working. How can I make sure the elements inside the slider resize uniformly based on screen size?

Answer №1

Your current styles are causing responsiveness issues on the following elements:

<div><p style=" font-family:'Aleo'; color: #4e4c4a; font-size: 1em; ">AR111</p><p style=" font-family:'Aleo';  color: #4e4c4a;  font-size: 2vw; ">Description of the product enters here <br> approximately 2 lines</p></div>

Avoid using top:-80px; position:relative; and top:-30px; position:relative; as they are not responsive.

Try removing all styles from these two p blocks to test responsiveness before gradually reapplying them.

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

Failure to send chat form

I have been developing a PHP chat application and everything is working well. However, I am looking to implement AJAX in order to prevent the page from refreshing. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></s ...

Launching an Electron Window and Recording the Closing Event

I am currently developing a Desktop Application using Electron. I want to implement a feature where clicking on a button in the main window (index.html) will open a different window. After researching, I discovered the BrowserWindow from the Electron API. ...

Having trouble with my mySQL insert query - any ideas?

After extensive research and code comparison, I am still unable to find the issue. My database refuses to update and the page remains unresponsive. This frustrating situation is compounded by the fact that I am using Notepad++ and struggling to identify th ...

I'm only seeing output on two of my input boxes - what's going on?

Currently in the process of learning JQUERY/HTML, I decided to create a shopping cart. My goal is to display the subtotal, tax, shipping costs, and total cost in input boxes. While I successfully displayed the sub total and shipping cost, I encountered an ...

Check if a specific class inside multiple divs with the same class is present using jQuery

I currently have three divs with the class UserDetail. The aim is to hide any UserDetail div that does not contain a div with the class "info". Update from comment: I attempted this solution: var childInfo=$('div.UserDetail').find("div.info"). ...

Switching the menu in mobile view: utilizing vue and pug

Hello, I am having trouble toggling my hamburger menu. When I check the console, it shows an error message: "nav is not defined". header.pug header.site-header div.navbar div.navbar__link.navbar--brand logo div.navbar ...

The Unique Font That Mysteriously Blocks Fake Italic Styles on Webkit Browsers

Currently, I am utilizing the PT Sans Narrow font in my project, which unfortunately only offers regular and bold styles. As a result, I require the browser to apply faux italics when needed. Strangely, this functionality is only working on non-webkit brow ...

Optimizing Title Tags for Static Pages with Header Inclusion

Working on developing static web pages for a client who preferred not to use a content management system. These pages all have a shared header and footer php files. I am in need of creating unique title and meta description tags for each page, but I am un ...

AJAX and Java combination causing issues with logging out in the system

I am working with AJAX using jQuery to trigger a function when clicking a link with the ID logOut. Here is the AJAX code: $("#logOut").click(function(){ $.ajax({ url: "Logout" }); }); This AJAX function calls my Java Servlet shown below: /** ...

Tips for accessing a DOM element's ::before content using JavaScript

Is there a way to retrieve the content of a DOM element's ::before pseudo-element that was applied using CSS3? I've attempted several methods without success, and I'm feeling very confused! // https://rollbar.com/docs/ const links = docum ...

Create a jQuery popup form with a variety of interactive buttons

Is it possible to implement a modal form in jQuery that can be triggered by multiple buttons? All the buttons have identical names and IDs. The goal is to display the modal form whenever any button is clicked. For this example, let's consider having ...

Injecting controllers and classes dynamically using AngularJS

I'm currently working on a dynamic widgets list where each widget is defined by its html, class, controller, and name. Some of these parameters may be empty based on the type of widget. These widgets are then loaded dynamically into <li> element ...

Can Facebox's settings be adjusted during runtime? If so, how can this be done?

Can Facebox settings be accessed and customized? For instance, I am interested in setting the location of the loading image dynamically as shown on line 4: <script type="text/javascript" src="<?php echo base_url(); ?>media/facebox/facebox.js" > ...

Issues arise when attempting to insert data into an HTML file using PHP

Good evening, I am having a problem where when I attempt to use PHP to replace "hello world" in an HTML file, it ends up completely empty each time. Can anyone point out what mistake I might be making? Here are the HTML and PHP files: <!DOCTYPE html&g ...

How to show PHP/HTML code within the PHP script and display it in HTML

Struggling to incorporate the following code into a PHP block for reuse on other webpages due to numerous errors. Any guidance on how to make this work? Here's the code block within a PHP file: <select name="products"> ...

Ensure that the sub menu and sub-sub menu are aligned to the same height

My goal is to have a drop-down menu with 3 Levels where the SubMenu and Sub-SubMenu are of equal height. The number of items in each column (Sub Menu and Sub-Sub Menu) should not affect their height. Below is the HTML and CSS code that I am using: html ...

Use jQuery to retrieve the href value of the <a> tag

There is an <a> tag with the href attribute: <a id="cancel" value="<?php echo $subID;?>" href="#">Cancel</a> I am looking to extract the value of $subID from this element and store it in a JavaScript variable. How can this be achi ...

Is it possible to tailor a jQuery widget by providing parameters and substituting my own callback function?

Being a beginner in jquery, I recently customized the jquery combobox to fit my requirements. Now, I want to use this modified component in various sections of my website by passing arguments and a callback function to manage specific events in jquery. How ...

What causes the variation in the appearance of the navigation bar across different pages?

I'm struggling to understand why the Navigation bar has extra padding or margin on top only on certain pages, while it looks fine on the Homepage. I've dedicated countless hours to this issue and I am feeling completely frustrated. If you' ...

Can a media source have a buffer that doesn't kick off with a key frame?

Is it feasible to utilize the media source extension to implement buffering such that buffers initiate with a typical frame rather than a key frame? For example, could the video be buffered frame by frame? (Even though that may not be the most practical a ...