Unable to utilize container-fluid on Chrome and tablet-sized screen due to compatibility issues

By using the container-fluid class, I have created a header that spans the entire front page. While this setup functions perfectly on Opera, Firefox, and Microsoft Edge, it falls short on Chrome, iPad, and mobile phone screens.

Take a look at my code:

<div class="jumbotron2" id="top">
     <div class="container-fluid"></div>
</div>

Here's the accompanying CSS:

.jumbotron2 {
  background: url(../img/xx.png) no-repeat center center;
  background-size: 100%;
  padding-top: 20%;
  padding-bottom: 20%;
}

.container-fluid {
       padding: 60px 50px;
}

How can I address this issue to ensure consistency across all devices? Thank you for your help.

UPDATE: I've included screenshots for reference:

Chrome full screen laptop - the background fills the entire screen

chrome full screen laptop

Chrome small screen - similar to tablet size chrome small screen tablet-size

The smaller the screen, the larger the white space above the header becomes.

Answer №1

To achieve a full-screen effect with the jumbotron, first remove any existing padding applied to it. If you want the jumbotron to fill the entire screen, you can use the following CSS:

.fullscreen-jumbotron {
  background: url(../img/xx.png) no-repeat center center;
  background-size: 100%;
  padding-top: 20px;
  padding-bottom: 20px;
  height: 100vh;
  width: 100vw;
}

Answer №2

Adjust the jumbotron's height to 100% in order to occupy the entire screen. Keep in mind that this adjustment might alter the background image's aspect ratio.

Visit this link for more information:

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

Is it necessary to set up Tailwind CSS for each new project we start?

Is it necessary to install Tailwind CSS and its files for each new project in every new directory? I'm uncertain if this is the correct process, or if there is an alternative method available. Furthermore, when making changes to files on a live serve ...

Nodejs Websocket integration with the Firefox browser

Currently, I am utilizing Aurora 17 along with Chrome 22 and Firefox 16 in order to develop a basic chat application. My server-side technology is Node 0.8.9. The issue I am experiencing pertains specifically to Firefox, as it fails to establish a connect ...

An irritating bug causing a 1px difference in Chrome 21

Hey there, I've encountered a strange issue with the datepicker on this website. It works perfectly fine on IE8+, Firefox 14, Chrome 20, and Opera 12. However, as soon as Chrome updated to version 21, things went haywire! I'm baffled and can&apos ...

Assistance with HTML and CSS to position an image in the corner

I need assistance with positioning a corner image on top of another image. I want the span, which has a small background image, to be in the top left corner of the main image. Below is my code: <div id="wrapkon"> <span style="width: 4px; height: ...

How come the arrangement of my columns is incorrect when applying the order class to a column in Bootstrap 5?

Can anyone explain why the last 3 Cards in the ordering are being displayed first on the web page? Once the "order-*" terms are removed, they appear in the correct order. This issue seems to occur when there are more than 5 elements in the row. <!DOC ...

Need to conceal certain images in Isotope, but ensure they can easily be revealed when necessary?

I have a collection of various images on my website coded with isotope. My question is, how can I hide specific images that I don't want to display initially, but have them appear when needed? I have managed to create a "show all" list using the code ...

What can I do to stop hidden HTML tags from loading on my page? Is it possible to completely remove them from the page

I previously inquired about this question but did not receive a satisfactory answer. Here are the input fields I am working with: <form method ="post" action="select.php"> <input id="nol" style="width: 350px;" type="text" name="searchdisease" pl ...

What is the best way to set up Paypal payments to automatically send out confirmation emails that are already in

Once the payment is processed, the website will send you your details. I am familiar with adding a paypal button, but how do I connect it to my website to automatically trigger the confirmation email after the payment has been completed through paypal? ...

Guide: Building Angular/Bootstrap button checkboxes within a loop

I am in the process of designing a grid (table with ng-repeat) in which each row contains 4 columns of buttons. My goal is to use checkboxes as the buttons, like the Angular/Bootstrap btn-checkbox, so that they can be toggled on and off. I plan to set thei ...

Message displayed within Ng-repeat loop

Having trouble implementing a tooltip within an ng-repeat for each item in a td element. Whenever the mouse hovers over an item inside the td, I want a tooltip to display with more details. The code below shows my setup, using ng-if to prevent displaying e ...

Beginner in html, css, and javascript: "Tips for saving jsfiddle demos?"

Recently, I developed an interest in JavaScript and CSS and came across some impressive examples on jsfiddle. I was wondering if there is a way to "export" these examples to my computer. Simply copying and pasting doesn't seem to work. How can I modi ...

Incorporating a refresh feature within the footer of a v-data-table using Vue.js

I really need to include a button in the footer section of my website. Up to now, my attempts to add a button have resulted in removing other elements, like page numbers, from the footer. The only solution I found involved sacrificing some features, as se ...

What is the method for creating a new line in a text box using "Shift + Enter"?

I've come across a few discussions regarding the differences between text area and text box, but I'm still unsure about it. Also, I am not sure how to create a new line in a text box by using "Shift + Enter." Thank you to everyone who can help m ...

Positioning CSS Div After Absolute Positioning Div

Can anyone provide guidance on how to smoothly continue the flow of a page using CSS? Let me explain my current dilemma: I have 3 divs - div 1 (parent), div 1 (child), and div 2 (normal). The parent div is absolute, the child is relative. Everything seem ...

CSS challenge: designing a tab interface

I am facing a CSS challenge that has got me stumped. I'm not even sure if it's achievable. Here is what I'm trying to achieve: There are three buttons/tabs displayed like this . When a tab is clicked, a different div should be shown for eac ...

Is an audio player/playlist necessary for showcasing a mix engineer's skills in their

As a newcomer to the world of web development with some background knowledge from school, I work as a mix engineer and have created a portfolio website. Previously, I utilized Soundcloud and Spotify's API to showcase my mixes/songs, but the external J ...

Enhance Your HTML Table Layout with Dual Column Borders

Can I increase the space between columns while still keeping borders on both sides? Check out the illustration below: ...

Entering numerous numerical values across a variety of input fields

My website currently has a form with 6 input fields where visitors need to enter a 6 digit code. To make it easier for them, I want to allow users to simply paste the code we provide into the first input field and have the remaining digits automatically po ...

AngularJS triggers ng-change event only when there are updates in the text box values

In my application, I have a text box that utilizes a custom directive called change-on-blur for field validation upon tab out. The issue arises when typing in the text box such as initially entering 'ABCD', deleting 'D', and retyping &a ...

hiding an "input type="file" element by using a button to conceal it

Is it possible to create a button that triggers file upload functionality? I couldn't find any solutions on Google. I've heard it can be done with labels, but I specifically need to use a button for better UX/UI. <button style="position:fixe ...