Stacking a responsive image on top of another image using Bootstrap

Currently, I am in the process of designing a platform for children to write letters to Santa. My main focus now is trying to incorporate an image of Santa riding on top of snow into the website design. However, I am facing difficulties making it responsive. Attached below is a mockup image demonstrating how I envision the Santa graphic fitting in with the rest of the elements on the page. Any suggestions on how to achieve this?

Answer №1

After a bit of restructuring, the container was finally able to function properly. When working with images, make sure to include the classes

img-fluid w-50 h-50 align-self-end

<!DOCTYPE html>
<html lang="en" referrerpolicy="no-referrer">

<head referrerpolicy="no-referrer">
  <meta charset="UTF-8>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- remove following in production-->
  <meta name="referrer" content="no-referrer">
  <title>Reindeer Express</title>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.2/css/bootstrap.min.css" rel="stylesheet" />
  <!-- link rel="stylesheet" href="css/style.css" -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script>
  <script src="https://kit.fontawesome.com/1463370ce3.js" crossorigin="anonymous"></script>
  <style>
    .bg-img {
      background-image: url("https://i.imgur.com/9L54Zdw.png");
      background-position: center;
      background-repeat: no-repeat;
      background-size: cover;
      position: relative;
    }
    .custom-shape-divider-bottom-1637548946 {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      overflow: hidden;
      line-height: 0;
      transform: rotate(180deg);
    }
    .custom-shape-divider-bottom-1637548946 svg {
      position: relative;
      display: block;
      width: calc(100% + 1.3px);
      height: 70px;
    }
    .custom-shape-divider-bottom-1637548946 .shape-fill {
      fill: #FFFFFF;
    }
    #stop-btn {
      display: none;
    }
    #how-to-mail {
      display: none;
    }
    #hidden-template {
      display: none;
    }
    .img-anim {
      transform-origin: 25% 75%;
      animation: ride 2s ease-in-out 0s infinite alternate;
    }

    @keyframes ride {
      0% {
        transform: rotateZ(356deg);
      }

      100% {
        transform: rotateZ(359deg);
      }

    }

  </style>
</head>

<body onload=display_countdown; referrerpolicy="no-referrer">
 <!-- Inserted HTML code omitted for brevity sake -->
  </script>
</body>

</html>

Note: I had to modify your code slightly by adding meta referer tags, including the Bootstrap CDN link, and compressing the background image for better performance. Feel free to customize or remove any animations you don't need.

Answer №2

Adding img-fluid to the image Class should make it work perfectly.

<img src="https://i.imgur.com/4n4uujr.png" class="img-fluid">

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

What is the best way to incorporate GLSL shader code from a separate file into the main HTML document?

Exploring the world of writing shaders has been an exciting journey for me. Using THREE.js to create an OpenGL scene and experiment with GLSL shaders has been incredibly helpful. So far, I have been embedding my GLSL code within a script field in the main ...

showcasing a set of div elements by using forward and backward buttons

I am dealing with 5 divs that have text content inside. To navigate through each div, I have implemented a back and next button system. <a href="" class="back-btn off">Back</a> | <a href="" class="next-btn">Next</a> <div class ...

Generating basic mesh shapes using three.js programmatically

Is there a way to easily generate basic shapes such as ramps, cones, and revolution shapes using only their vertices in three.js? ...

What is the best way to transfer an element and all its children to another div without losing any jQuery functionality?

At first, sharing an example of the JavaScript and HTML from my page is challenging because I couldn't make it work on JSfiddle. The issue I'm facing involves jQuery on a page where I've created two tabs. Essentially, it's the same con ...

"The useTheme hook is not functioning as expected when used within a className

I've defined a custom theme in my App.js file like this: let theme = createTheme({ palette: { bgCells: { textAlign: 'right', color: '#8ccadf', backgroundColor: '#eef7ff' } } }); In another c ...

How can you apply the min-width property to a CSS element floating to the right?

Check out this demonstration When utilizing float:right in the CSS rules, the html does not adhere to the specified min-width. .right { float:right; background:blue; min-width:400px; } By removing the float:right or adjusting it to float:lef ...

Prevent page refresh when submitting a form using PureCSS while still keeping form validation intact

I'm currently implementing PureCSS forms into my web application and facing a challenge with maintaining the stylish form validation while preventing the page from reloading. I discovered that I can prevent the page reload by using onsubmit="return f ...

Creating a variable with the use of @include

Here's a question that I need help with. I have a SASS @include function that dynamically calculates the font size. h2 { @include rfs(2rem); } I use this to adjust the font size based on screen resolution, but I'm facing an issue where a gre ...

What is the method to retrieve the class name of an element when the div is created as '<div id 'one' class="element one"></div>'?

I have three elements named one, two, and three, declared as seen below: <div id =container> <div id 'one' class="element one"></div> <div id 'two' class="element two"></div> < ...

Learn how to design a customized loading screen using CSS with Phonegap

Currently working in Android with Phonegap / Cordova, I am faced with the challenge of optimizing page loading time due to numerous DOM objects being created. To address this issue, I am attempting to implement a "Loading..." screen to prevent users from b ...

Angular animation triggered when a specific condition is satisfied

I am working on an animation within my Angular application @Component({ selector: 'app-portfolio', templateUrl: 'portfolio.page.html', styleUrls: ['portfolio.page.scss'], animations: [ trigger('slideInOut&apo ...

The addClass and removeClass functions in jQuery are functioning properly only on Firefox browser

Could someone help me understand why this code works in Firefox but not in Safari or Chrome? The variable newClass retrieves the value from a select box, which is then used to create a selector for adding or removing classes using addClass/removeClass. I ...

What is the best way to deactivate all 67 checkboxes once 4 of them have been chosen?

I am looking to limit the selection of checkboxes to only 4 out of a total of 67. However, I am currently struggling to figure out how to monitor the checkboxes and determine if exactly 4 have been selected. <table class="mdl-data-table mdl-js-data-t ...

CSS3 :not does not exclude a selector by id

Hello wonderful community of Stackoverflow, Here is my CSS code: .text:not(#overview > *) { margin-top: 10px; margin-bottom: 10px; } I am trying to apply a 10px top and bottom margin to everything with the class "text", except for elements ma ...

Can a form be submitted to two different pages based on the button name?

I have a form that directs to another page and performs various database operations. <form id="form1" method="post" action="goes_to_page1.php" onsubmit="return checkformvalidation();"> <input type="text" id="field1" name="field1" onblur="checkva ...

Achieving and maintaining the center alignment of a horizontal dropdown menu

Struggling with creating a fixed, 100% width nav bar that stays centered when the page is resized? The drop down menu headings are causing issues as they seem to float left instead of staying centered. Not sure how to fix it? Take a look at the live resul ...

Screen size impact on positioning

Before I delve into the issue I'm facing, I want to emphasize that despite searching for existing solutions, I have not been able to find one that works. This problem has been blocking me for a week now, and I am in desperate need of assistance. The i ...

`CSS Animation fails to run in Internet Explorer and Microsoft Edge browsers`

My issue with the CSS animation is that while the opacity animates properly, the translate effect does not seem to work as expected. You can see the problem here: https://jsfiddle.net/bLxb8k3s/ It appears that the reason for this issue is because IE and ...

Incapable of modifying the text within a div container

I am currently working on a script that translates a Russian forum word by word using TreeWalker. However, there is a specific type of div element that I have been unable to change the text for. That leads to my question: How can I go about changing it? Un ...

AngularJS search box functionality allows users to easily search through a

1 I am looking to develop a search box using AngularJS similar to the one shown in the image. While I am familiar with creating a normal text box, I am unsure of how to incorporate the search icon. Any guidance on how to achieve this would be greatly appr ...