Tips for eliminating excess space on mobile devices with CSS

When testing the responsiveness of my banner image at a specific breakpoint, I noticed white space. You can see the issue on my website here.

https://i.sstatic.net/Oug2R.png

I have tried the following CSS:

html,
body {
    width: 100%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow-x: hidden;
}
* { margin: 0; padding: 0; } 
* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box
}
img{
    width: 100%;
}
* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box
}

I'm still struggling with the white space issue on my page. Any help or guidance on how to get rid of it would be greatly appreciated. Thank you in advance!

Answer №1

After a significant amount of effort, I finally managed to track it down. I'm pretty confident that this is the solution.

.marketing-main-page-content_description-right p {
     width: 600px;
}

At line 305 in style.css, consider either removing this rule entirely or implementing a media query for it.

Answer №2

Within the "marketing-main-page-content-agenda_elipse" container, there are 2 elements known as "elipse-top" and "elipse-bottom" with absolute positioning. These elements increase the container's width due to their "right" position. Consider modifying their properties for better responsiveness in design.

Answer №3

Avoid using the % unit in the body and html tags. Instead, utilize the vw unit, which represents the viewport width. One vw is equivalent to 1% of the viewport width. Therefore, it is advisable to set html and body widths to 100vw.

html, body {
    width: 100vw
}

Refer to the image below for a clearer illustration. https://i.sstatic.net/kepCQ.png

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

FAQs about utilizing percentage width and margins in CSS with Bootstrap

Currently, I am working on a mobile responsive web design using Twitter Bootstrap 3, and I am facing challenges with margins and resizing. I previously asked about creating a mobile-first responsive web design along with responsive images, which you can f ...

Tips for redirecting to the index page instead of the login form after pressing the back button on the navigation

Hey everyone! I've been struggling with a problem for the past 4 hours and could really use some help. After logging in, the page redirects to a certain page, but when I press the back button in my browser, I want it to redirect back to that specific ...

Error importing reach-router in Gatsbyjs causing website to break

While working on my Gatsby project, I decided to incorporate the React Cookie Consent package. However, upon installation and implementation attempt, my website crashed, displaying this error message: warn ./.cache/root.js Attempted import error: &a ...

Is it possible to transfer data to the next page by clicking on a table row?

I'm facing an issue with a non-clickable table. When a row is clicked, I want to navigate to a detail page from the table while passing the id value in the process. I know that I need to create an href attribute on the table row and somehow transfer ...

Here is a guide on how to ensure that the div elements automatically fill the available space

Looking at this html page: Check out the jsFidlle Demo here I am aiming to have the boxes fill up the space effortlessly, each with equal width but varying heights. This is similar to the layout in Google Keep notes ...

Trouble displaying images from JSON file in AngularJS using ng-src - need help with image loading

While utilizing AngularJS to extract image data from a JSON file, everything seems to work fine for other types of data except images. Why is the ng-src not retrieving any images? I am attempting to load all the images into the div and set the src, alt, a ...

The PHP code I wrote will be executed on the subsequent HTML page, not the one currently being displayed

I have a school project where I am creating a quiz-game web page. Each question will have 4 possible answers. The questions, along with their 4 answer choices and the correct answer, are randomly selected from a database. However, I am facing an issue w ...

How can I use jQuery to identify the numerical range within class/td/div elements and modify their CSS styles?

1# I need assistance in changing the CSS properties of a TD, Class, and div using a selector that specifies a specific number range. Specifically, I am looking to modify the css of torrent results with a seed count between 250-25000. Any torrents with a se ...

What is the best way to ensure that the CSS padding for a button matches the width of the column consistently?

I have encountered an issue where I am unable to maintain consistent padding for a button relative to the column width. This is crucial for me because the button's background changes when a user hovers over it. However, using a fixed value for the but ...

Angular 17 | Angular Material 17.3.1: Problem encountered with Angular Material form field focus and blur event handling

I attempted to apply (blur) and (focus) effects to my mat-form-field input field, but it seems like they are not working properly on my system. Here is a code snippet that resembles what I am using: html file <form class="example-form"> ...

Is it possible to translate the content of the page into English and French simply by clicking on the designated buttons?

As I dive into working with knockout, I am still in the learning process. Currently, I have a dropdown code where selecting English translates the entire page to English and selecting French translates it to French without any issue. I believe this functio ...

What distinguishes submitting a form from within the form versus outside of it?

When the code below, you will see that when you click btnInner, it will alert 'submit', but clicking btnOuter does not trigger an alert. However, if you then click btnInner again, it will alert twice. Now, if you refresh the page: If you first ...

Configuring a JavaScript calendar with custom margins

Having trouble selecting a date with the Bootstrap datepicker class. After running the snippet, the calendar appears below the textbox: <input type="text" class="form-control datepicker" name="due_date" id="due_date" onclick="calendar_up()" value="" pl ...

Execute PHP script through jQuery request within the context of a Wordpress environment

I want to replicate a specific functionality in WordPress. In this functionality, jQuery calls a PHP file that queries a MySQL table and returns the result encapsulated within an HTML tag. How can I achieve this? <html> <head> <script ...

Guidelines for dynamically displaying <router-link> or <a> in Vue based on whether the link is internal or external

<template> <component :is="type === 'internal' ? 'router-link' : 'a'" :to="type === 'internal' ? link : null" :href="type !== 'internal' ? link : null" > <slot /> < ...

Guide on inserting an item into a vertical navigation menu

When it comes to creating a vertical menu, I rely on Bootstrap 5. https://i.sstatic.net/8CWYK.png The issue I'm facing is how to add a black background to the top of the left menu. https://i.sstatic.net/yoEcO.png I am unsure whether I should imple ...

What is the best way to utilize an onClick on a button to update a value that is being utilized in a useEffect hook?

I am looking for a way to dynamically change the content displayed in this section without navigating to another page. I have two sets of data - one displaying all blogs and the other showing only blogs authored by "mario". How can I implement a button cli ...

Variable Returned by AJAX

I am attempting to send a variable using a select box via POST method, then use AJAX to submit the data and finally leverage that variable on the original page to update SQL queries. Below is the code snippet I currently have: <script type="text/j ...

Is there a way to change the color of the menu button to white if the points are not visible?

I have created CSS to style the menu's color and make the buttons change color based on different actions. However, I also want the buttons to match the colors of the points on the map. To achieve this, I set the background color in JavaScript when ge ...