How can we create a responsive navigation bar that is vertical for desktop and horizontal for mobile devices?

On the desktop version, we have a left column (with vertical steps) and a right column. However, on the mobile version, the left column appears above the right column.

My goal is to display the 4 steps horizontally in the mobile version, but my attempted solution did not work. I am unsure why this is happening.

Could anyone help me solve this issue?

<div class="row">
<div class="col-lg-4 col-md-5 col-sm-12 blue">
<div class="p-2">
                
<div class="row">
<div class="col-3 col-sm-12">step 1</div>
<div class="col-3 col-sm-12">step 2</div> 
<div class="col-3 col-sm-12">step 3</div> 
<div class="col-3 col-sm-12">step 4</div>   
</div>


</div>
</div>

<div class="col-lg-8 col-md-7 col-sm-12 bg_blue white">
<div class="text-center p-5">
<h1 class="pt-5">Simulator</h1>
<h2>Are you already associated with us?</h2>
<div class="m-5">
<button action="" type="button" class="btn round btn-outline-light btn-lg">YES</button>
<button type="button" class="btn round btn-outline-light btn-lg">NO</button>
</div>
</div>
</div>


</div>

Answer №1

It seems like you want to arrange the steps in a horizontal view.

<div class="row">
<div class="col-3 col-sm-12">step 1</div>
<div class="col-3 col-sm-12">step 2</div> 
<div class="col-3 col-sm-12">step 3</div> 
<div class="col-3 col-sm-12">step 4</div>   
</div>

If you want them displayed horizontally, here's how to do it:

<div class="row">
<div class="col-12 col-sm-3">step 1</div>
<div class="col-12 col-sm-3">step 2</div> 
<div class="col-12 col-sm-3">step 3</div> 
<div class="col-12 col-sm-3">step 4</div>   
</div>

Best of luck with your coding!

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

The HTML element in the side menu is not adjusting its size to fit the parent content

Update: What a day! Forgot to save my work... Here is the functioning example. Thank you for any assistance. I have set up a demo here of the issue I'm facing. I am utilizing this menu as the foundation for a page I am developing. The menu is built ...

Alert appearing before the user navigates back using the browser button

Is there a way to display a message to the user before they navigate away from the app by clicking the back button in their browser? In my app, I've disabled the ability for users to go back using the browser's buttons and instead provided intern ...

Issue with uneven spacing on both ends of the screen on mobile devices

I have successfully used a <div style="margin:0 auto; "> tag with the specified property, working perfectly. However, I added another <div> above and set the float as follows: .gallery-div{ background:url(images/gallery-bg.png) repeat-y; ...

Arranging the placement of the close button within the Lightbox

After successfully integrating the 'Responsive Lightbox Lite' plugin into my Wordpress website, I have encountered a minor customization issue. I wish to relocate the close icon within the lightbox itself (preferably at the top right corner) ins ...

Issue with Table Tags Not Being Properly Nested Within P Tags in the Document Object Model

While experimenting with dynamic changes to innerHTML content, I have observed some peculiar behavior when it comes to tables nested inside other elements. For instance, when creating a form with a table nested within paragraph tags like this: p /p p tabl ...

Is it possible to make Plotly save plots in their original size?

I am currently using R for data analysis and visualization. I found a helpful tutorial that guided me to create the following plot: library(dplyr) library(plotly) data <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/gapminde ...

Clicking the save button in the modal updates the text on both the current tab and any previously clicked tabs

I'm looking to implement tabs that, when clicking on the edit icon, open a modal for editing the content of each tab. The issue I'm currently encountering is that if I open the editor for one tab, close it without saving, then open the editor fo ...

Achieving a layout of three columns and two rows (1 x 2 x 2) using flexbox

I am looking to achieve a specific layout using Flexbox. While I am comfortable with CSS, I want to challenge myself by learning how to implement this design using Flexbox for more concise and maintainable code. https://i.stack.imgur.com/QDVfT.png .ban ...

Displaying a specific fieldset based on the radio button selection

I have created a form to handle user input using PHP, with the initial question prompting the user to choose from three radio buttons for the "type" parameter - the options being "book", "journal", and "website". Here is what the code looks like: <stro ...

"Efficiently handle online submissions: Use Django to submit a form and instantly display the outcome

I have an urgent task to develop a web page where users can input data, and the backend will perform calculations and display the result below the input field on the same page (similar to checking online air ticket prices). I am new to Django and HTML. Be ...

My line occupies an excessive amount of vertical space

Working on a practice website and realizing my CSS skills are a bit rusty. Struggling with the height of a row in my container, as it's taking up too much space. Also, having trouble positioning the second row below the first one without it ending up ...

Positioning a flash element in the center

Struggling to find the perfect alignment for a flash widget on this particular page . Experimented with using both the <center> tag and various other methods, but alas, it remains stubbornly off-center. If anyone has any suggestions or solutions, p ...

How do I print a QTableWidget using QT5 and resize the table to fit perfectly on one side of an A4 sheet?

My QT5 application is designed to generate a monthly rota/timesheet in csv format, which can be easily read and printed using Excel or LibreOffice. However, I want to enhance the functionality by printing the table directly from Qt to the printer. I have ...

The AJAX data variable fails to send to PHP script although $_POST is defined

I am at my wit's end with this problem. I am attempting to send a variable to a PHP script using AJAX, and although I can confirm that $_POST is set, the variable remains undefined. Oddly enough, I have used almost the same code in other instances an ...

Element Style Does Not Align with Computed Z-Index

Currently, I am in the process of developing an HTML5 video player. However, I have encountered a problem where my custom controls become unclickable once the video element is set to fullscreen mode. This issue arises because the video's z-index is se ...

Troubleshooting image overlay alignment concerns

My script successfully adds the image src to the overlay's image, but I encounter a problem when creating the variable imgH for the margin-top value. It calculates the image's height and divides it in half. The issue arises when the calculated h ...

Issues arising with carousel pager in Cycle2 slideshow not functional

Our unique pager is designed with the "Advanced Custom Template" on a dynamic carousel slideshow. Everything seems to be running smoothly until I interact with the pager - then things start acting strangely. The active slide doesn't change position a ...

Obtain User Input from a TextArea Element on an HTML Page using ASP.net

In my asp.net 4.0 project, I am using jTemplates to create a HTML-Page that includes a text area and a submit button. I am looking for a way to retrieve the value entered in the text area when the user clicks on the submit button. Can anyone provide guid ...

Position an image to the right with a specific height using position absolute in Bootstrap 4.3

enter image description hereI am in the process of updating my Bootstrap 4.0 CSS to Bootstrap 4.3 CSS. Within my price section, there are 3 pricing panels. One of these panels includes an image with absolute positioning and specific pixel coordinates - l- ...

I am experiencing some trouble with configuring the CoreUI Admin Template

I've encountered an issue where I've tried various methods to implement this theme but haven't had any success. 1. I followed the steps in the documentation by cloning the repo of the template and then using npm install (npm run serve) -> ...