"Challenges arise with content layout when the screen size shrinks in

Having trouble with the layout on smaller screens - I want the image above the button but below the text. I'm new to bootstrap and haven't been able to figure it out by reading the docs. Can someone please help me identify the issue and explain why it's happening? Thanks!

<div class="row">
          <div class="col-sm-6 text-center h-80 text-center">
              <p style="display: flex;
              padding-inline-start: 140px;
              justify-content: center;
              margin: 0;
              align-items: center;
              text-align: center;
              font-family: Dancing Script, 'sans serif';
              width: 80%;
              height: 50%;
              color: white;
              font-size: 80px">So you want to travel the world</p>
              <p style=" display: flex;
              color: white;
              padding-inline-start: 60px;
              width: 100%;
              height: 20%;
              font-size: 30px;">I do not have millions in the bank but I am making it happen without stress or worry.</p>
              <button style="border: none;
              color: white;
              font-size: 30px;
              background-color: rgba(201,115,116,255);
              border-radius: 5px;
              height: 60px;
              cursor: pointer;
              width: 400px;">Download!</button>
          </div>
          <div class="col-md-6  text-center">
            <img src="images/Digital Download! (1).png" id="img-fluid" class="img-fluid" style="height: 700px; width: 1300px;" alt="">
          </div>
        </div>
      </div>

Answer №1

The button will always be below the image since they are in different columns.

<div class="container">
<div class="row>
          <div class="col-sm">
              <p>Are you dreaming of exploring the world?</p>
              <p>Even without millions in the bank, I am fulfilling my travel dreams stress-free.</p>
          </div>
          <div class="col-sm">
            <img src="images/Digital Download! (1).png" id="img-fluid" class="img-fluid" style="height:   700px; width: 700px;" alt="">
          </div>
          
          <div class="col-sm-12">
              <button> Download Now!</button>
          </div>
        </div>
</div>

This layout ensures that the download button is situated below the text and image, except when on a small screen where they stack vertically. It's recommended to separate your CSS into an external file and utilize bootstrap utility classes as suggested above.

Additionally, it's advisable to use only alphanumeric characters in your filenames whenever possible.

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

Basic Timer with Visual Background

Struggling to find the right CSS/script for a straightforward countdown timer, Here are the requirements: Countdown in days only, no need for hours, minutes, and seconds Ability to use a custom image as background I've scoured online searches but n ...

Positioning of Ajax modal popups on smaller screens

In my Asp.net/C# web application, I have a modal popup that contains multiple placeholders. However, I am facing an issue when trying to access the modal popup on smaller screens like iPads or iPhones. The page only displays half of the modal popup, maki ...

Tips for eliminating the bottom border on a nav-tab in Bootstrap 4

When a vertical navigation menu item is selected, a border appears below the item. How can I remove this border? .nav-tabs li, .nav-tabs li a { border-bottom: none; } Here is a picture of the border: ...

Unable to utilize the ng-disabled directive

Although this question may seem redundant, rest assured that I have exhausted all possible solutions. The issue lies in a disabled button using ng-disabled. I have a variable in the $scope that triggers a change in the ng-disabled attribute, but it fails t ...

Is there a way to remove the jQuery .css() upon clicking a different button?

I am currently working on a jQuery switch where I want the clicked button to revert back to its original state when another button is clicked. Additionally, I want the 'OFF' button to be automatically clicked first when the page loads. Despite tr ...

Executing the Javascript function specified above upon the page being loaded

I'm fairly new to JavaScript, so please bear with me. I've got a JavaScript function on my page: <script type="text/javascript"> Sys.debug = true; var popup; Sys.require(Sys.components.popup, function () { popup = Sys.c ...

Struggling to make images wrap properly using flexbox

I've been struggling to get these images to wrap properly within my container. They keep overflowing beyond the designated width and I'm not sure if it's because I have paragraphs placed under each image. Any ideas on how to make 3 images ap ...

Is the z-index useless when the button is positioned behind divs and other elements?

I would like the "Kontakt" button to appear in the top right corner of the page, always on top of everything else. I have tried setting the z-index to z-index: 99999999999 !important;, but it doesn't seem to be working... On desktop, the button displ ...

Decrease the size of the mat-flat-button

I have a message board where I am trying to incorporate delete buttons. However, when using the mat-flat-button feature, it appears to be increasing the height of the message items. If I adjust the button's height to 50%, then the button becomes half ...

Tips for incorporating a local image using file:// in JavaFX WebKit

I am facing an issue with displaying a picture in a JavaFX webview using local HTML. Despite writing the code, I am unable to show the image. The URL of the image is "file:/D:/a.jpg". //Main WebViewBrowser.java public class WebViewBrowser extends Appli ...

What could be causing spacing problems with fontawesome stars in Vue/Nuxt applications?

Currently, I am working on implementing a star rating system in Nuxt.js using fontawesome icons. However, I have encountered an issue where there is a strange whitespace separating two different stars when they are placed next to each other. For instance, ...

Is using window.postMessage(...) a viable option for facilitating cross domain file uploads?

I'm wondering if there is a way to achieve cross domain file upload using window.postMessage(...) or any other technique. Can anyone help with this? ...

Maintaining Flexbox layout without triggering item re-rendering for a new container

This is the unique layout I'm aiming to create: I am facing a challenging flexbox layout that needs to be implemented. One of the items in this layout is a Webgl player, which cannot be conditionally rendered due to the restarting issue it may cause. ...

The issue arises when attempting to apply CSS styles to an existing component or body tag,

I am currently working on an Angular 7 project where I have a requirement to dynamically load a component using routes. However, when I try to add styles for the body tag and existing component tags in the dynamically loaded component style-sheet, they do ...

What method can I use to enlarge the carousel component from the flowbit-svelte library?

I have been working on a project that requires a Carousel, and I decided to incorporate the flowbit-svelte carousel into my svelte project. While the carousel is functioning well, I am facing an issue with the component size. It seems to be cutting off my ...

What is the best way to ensure that an HTML5 audio element buffers an entire song?

I am currently working on a project to create a local server that will allow users to stream their audio files through web browsers using the HTML5 audio object. Despite the fact that these files are stored on the user's computer, I have encountered a ...

Displaying outcomes within 2 nested loops

Currently in the process of developing a fast-food website, I have completed most of it except for implementing the menu display feature which will vary for each signed-up takeaway. My approach involves organizing items into categories so that takeaways ca ...

Retrieve email addresses from an HTML document

I recently obtained the HTML source code from a website and am now exploring ways to extract specific content, such as email addresses, from the source. I am considering utilizing a tool like jsoup with the following function: public static String html2te ...

`The header navigation is not responding to window resizing functionality`

I am currently developing a header navigation that consists of a logo on the left side, a profile icon on the right side, and some navigation links in the middle. A left slide menu has been implemented to trigger when the window width is less than 700px. ...

PHP column number not found

Seeking assistance with a puzzling situation I encountered. My website features a form for administrators to submit user information, including links. The challenge lies in the uncertainty of how many links will be submitted - it could range from 5 to 35. ...