What is the process for layering two images and positioning them at the bottom of a mobile screen?

I am encountering an issue with white space at the bottom of my mobile-responsive page. Specifically, I have two overlapping images within a div that I want to position at the bottom of the page, but I am unsure of the correct approach to eliminate this white space.

Here is my HTML:

<div id="wrapper">
  <img id="purpleMobile" src="./assets/purpleMobile.svg" alt="Purple" />
  <img id="rocketMobile" src="./assets/rocketMobile.svg" alt="Rocket" />
</div>

CSS:

#wrapper {
  display: flex;
  position: relative;
  bottom: 1;
  left: 0;
  width: 100%;
  margin-top: auto;
}
#rocketMobile {
  left: 0%;
  bottom: 0;
  position: absolute;
}
#purpleMobile {
  right: 0%;
  bottom: 0;
  position: relative;
}

Answer №1

To ensure proper formatting, consider incorporating a reset in your CSS file. You might want to experiment with the following code snippet:

 body {
        padding: 0;
        margin: 0;
    }

Argus

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

Animate the transition effect as soon as the block is displayed

Looking to create a smooth page transition using CSS changes with the help of Javascript (jQuery). Initially, one of the pages is set to display none. page1 = $('.page1'); page2 = $('.page2'); page1.removeClass('animate').cs ...

Updating the DOM after scrolling using jQuery

jQuery hover functionality is not working correctly after scrolling. $(document).ready(function() { $('img').hover(function(){ alert('hello'); },function(){ alert('hello not'); }); }); When hoveri ...

SCSS, target class, and also the active class

It seems like this could be simplified. Any suggestions for improving this in SCSS? .tab, .tab.active { margin:0; padding:5px 0 5px 8px; } ...

The white background of the .jpg image is conflicting with the white background of the HTML

My website has a top-of-page .jpg image that was created with a white background. However, when using the img src="topOfEveryPageImage.jpg" tag, the white background of the image appears visually different from the rest of the solid white background on the ...

What is causing the variables in my HTML tags to not appear?

I am currently working on a component to display random products from an array. Despite being able to see the attributes like props.products[random].company when I console log them, they are not rendering properly when placed inside HTML tags. Although th ...

selenium for extracting data from span class tag

After trying to click the button with the text "details," I encountered a "no element found" error. It seems like the tag is within a child class... span _ngcontent-tbi-c3="" class="ng-star-inserted">Details</span Below is my Python code snippe ...

Transition one background image into another using background positioning

Snippet of code: https://jsfiddle.net/foy4m43j/ HTML: <div id="background"></div> CSS: #background { background-image: url("http://i.imgur.com/hH9IWA0.png"); background-position: 0 0; background-repeat: repea ...

I am interested in retrieving data from MySQL by utilizing the FullCalendar plugin

Is there a specific location in my PHP code where I should place a for loop in order to loop through dates in the database? Take a look at this snippet: <script> $(document).ready(function() { $('#calendar').fullCalendar({ d ...

What is the best way to assign a unique name to a dynamically generated text box using jQuery

In an effort to name a dynamically created textbox based on a specific event, I attempted the following code. The function GenerateTextBox was intended to assign a name and value of "" to the textbox upon generation, however, the name did not get assigned ...

Activating a div in React.js using setActive: Step-by-step guide

Currently, I am in the process of developing an application with three menu tabs, each represented by an accordion comprising a menu title and content. The issue I am facing is that when clicking on any menu title, all content divs are displayed simultaneo ...

Customize the columns of your Angular Material 2 table by defining them using TemplateRef and ngTemplateOutlet

Looking to create a flexible material table with the ability to utilize TemplateRef along with ngTemplateOutlet for generating columns. Check out this demo where I have employed the cards component within my custom material-table component. Inside the card ...

Generate an overlay div that does not impact the content of the top div

My website has a specific requirement where I need an overlay div to cover the entire body when hovering over the menu. <header><menu><ul><li class="new-menu">menu1</li></menu></header> <div id="myNav" class= ...

Is it possible to store data using express.js and display it on a webpage without utilizing a database?

Currently, I am working on a project that involves creating a website where users can input blog text posts and then view those posts. My tech stack includes HTML, CSS, JavaScript, Node.js, EJS, and Express.js. Due to restrictions, I cannot use a database ...

What could be the reason for the navigation bar menu items not showing up in the sample application of the twitter.bootstrap.mvc4 package?

After setting up a new MVC4 web application project in VS2012, I decided to add the http://www.nuget.org/packages/twitter.bootstrap.mvc4.sample/ nuget package. However, upon running the sample application, I encountered an issue where the navigation menu i ...

The DIV element fails to encompass all of its content

There seems to be an issue with the only div element on my page. It's covering the middle of the page, but I managed to make it extend all the way down using CSS tweaks. However, there is a problem - the video inside the div is overflowing: Below is ...

What makes CSS so intricate and challenging to navigate?

While going through a CSS tutorial, I encountered this detailed definition: .content div { -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; box-shadow:inset 0px 1px 0px 0px #ffffff; backgroun ...

I have tried to create two apps in AngularJS, but unfortunately, they are not functioning as expected

Having trouble with implementing 2 ng-app in a single html page. The second one is not working. Please review my code and point out where I am making a mistake. <div id="App1" ng-app="shoppingCart" ng-controller="ShoppingCartController"> &l ...

CSS Conflict with jQuery Tools Overlay causing the image to be hidden beneath the overlay

First, let me explain what I am currently using and attempting to achieve: I started with the basic setup for this effect found at flowplayer.org/tools/demos/overlay/index.html Then, I implemented the Apple Leopard Preview Effect from flowplayer.org/tool ...

How to apply a series of spaces using span/tspan with jquery/javascript

Check out this fiddle: http://jsfiddle.net/jzLu4toe/3/ <span id='tghj'></span> $('#tghj').text('Hey There'); I'm facing an issue where I need to insert multiple spaces inside a span element. ...

Display exclusively the provided value

Can someone please help me with printing in PDF style and displaying only the inputted value without showing the textbox or dropdown? Check out this image for reference I would like to achieve something similar, how can I do that? Any assistance would be ...