Tips for creating a mobile-friendly appointment section on your website

Hey guys, I need some help with a problem I'm having. I created an appointment page that works perfectly on desktop mode, but when I try to view it on mobile, it's not responsive. Can anyone assist me in fixing this issue?

Appointment.js

Here is the code for my appointment page where I've put all my efforts. I really want it to work properly on mobile view. https://i.sstatic.net/IRpWg.png

import React from 'react';
import './Appoinment.css';

const Appoinment = () => {
    return (
        <div className="backimg">
            <div className="container mt-5 shadow-lg p-3 mb-5 bg-white shadow-lg p-3"  >
                <h2>Book Appoinment</h2><br/>
                <form>
                    <div class="row">
                        <div class="col">
                            <label className="label" for="inputEmail4">Patient Name</label>
                            <input type="text" class="form-control shadow-none" />
                        </div>
                        <div class="col">
                            <label className="label" for="inputEmail4">Doctor's Name</label>
                            <select name="select" class="form-control shadow-none">
                                <option selected>Doctor Name1</option>
                                <option selected>Doctor Name2</option>
                                <option selected>Doctor Name3</option>
                            </select>
                        </div>
                        <div class="col">
                            <label className="label" for="inputEmail4">Department's Name</label>
                            <select name="select" class="form-control shadow-none">
                                <option selected>Cardiology</option>
                                <option>Diagnosis</option>
                                <option>Surgery</option>
                            </select>
                        </div>
                    </div><br /><br /><br />
                    <div class="row">
                        <div class="col">
                            <label  className="label"for="inputEmail4">Phone Number</label>
                            <input type="text" class="form-control shadow-none" />
                        </div>
                        <div class="col">
                            <label className="label" for="inputEmail4">Symptoms</label>
                            <input type="text" class="form-control shadow-none"  />
                        </div>
                        <div class="col">
                            <label className="label" for="inputEmail4">Choose Date</label>
                            <input type="date" class="form-control shadow-none"  />
                        </div>
                    </div><br />
                    <button className="btn btn-outline-primary">Submit Now</button>
                </form>
            </div>
        </div>
    )
}

export default Appoinment;

Answer №1

To enhance the design of your columns, switch out the className col with className="col-md-4 col-12"

On smaller devices, the columns will span across the entire width, while on screens ≥768px, they will occupy 1/3 of the width.

Update: Remember to change class="" to className as well

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

How can I dynamically alter the width of a Bootstrap progress bar using the {{$percentage}} variable in a Laravel stylesheet?

I am currently working on a project where I aim to display the percentage of marks obtained using a progress bar. I have the percentage value and I am trying to pass this value in the style: "width:{{$percentage}}" so that the progress bar width changes a ...

My goal is to generate a collection of fullwidth ion-cards using data from an array of objects

I am attempting to iterate through an array of objects in order to generate a set of cards, either FULLWIDTH or halfwidth with the last one centered if the count is an odd number. I have created a component that contains the card layout and I am using *ng ...

Troubleshooting problem with Bootstrap column and grid dimensions

I have a Bootstrap page displaying a title along with 2 forms in a single row positioned above a table. The 2nd form, located at the top left above the table, is currently occupying the full width of the parent column (col-md-8) when it only needs to occup ...

Create both the opening and closing list tags for list items with the help of draft-js and draft-convert

Currently, I am utilizing <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6602140700124b0c1526564857574851">[email protected]</a> and <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0b6f ...

transmitting information to a RESTful endpoint through an Ajax request

I've been attempting to send a small table of data to my REST endpoint through Ajax, but unfortunately, I am not seeing the results in the backend code as expected. Here is the snippet of my Ajax request: submitData:function(){ var self = this; var ...

Having difficulty starting 'npm start' in ReactJS

I am a newcomer to ReactJS and the Yeoman generator. I have encountered a problem after generating a project using the following command: npm install -g yo npm install -g generator-react-webpack yo react-webpack After setting up the project name, using ...

Employing the Map function in React leads to an error that is undefined

Upon simplifying my code, it seems that I am encountering an unresolved issue with the map function being used in different locations. I have noticed that code from examples running on platforms like Codepen does not work in my locally created react app p ...

While working on a project in React, I successfully implemented an async function to fetch data from an API. However, upon returning the data, I encountered an issue where it was displaying as a

I am working with React and TypeScript and have the following code snippet: const fetchData = async () => { const res: any = await fetch("https://api.spotify.com/v1/search?q=thoughtsofadyingatheist&type=track&limit=30", { met ...

An image on the left side of a perfectly aligned text

I am currently working on aligning an image and text for a logo. However, I am having trouble justifying the second line to the width of the block. Here is the desired result: This is what I have tried: @import url(http://fonts.googleapis.com/css?famil ...

The Bootstrap 4 Toggler Dropdown lacks a background color

Struggling to style the toggle dropdown on smaller screens to match the regular navbar background? Can't seem to figure out how to target it. Is there a missing bootstrap class or an error in the code? Initially suspected the border might be causing i ...

React and Bootstrap's responsive navigation bar - having issues with the hamburger icon

After successfully creating a basic navigation menu using Bootstrap with no issues in pure JavaScript, I encountered a problem when trying to integrate it into React. The hamburger icon, intended to toggle the menu on click, is not functioning as expected. ...

Set the height of the vertical scroll at a fixed 100% floatValue

Check out my creation at http://jsfiddle.net/ZygnV/ html, body { margin: 0; padding: 0; height: 100%; } .main-content-wrapper { height: 100%; overflow-y: hidden; white-space: nowrap; } .main-sidebar { display: inline-block; height: 1 ...

Maintaining the placement of an element in a fixed position while adding a border

Currently, I am in the process of developing an interactive online picture framing tool. My aim is to allow users to customize an image by selecting different border, mount, and frame sizes. These customizations will be reflected in real-time by adding cor ...

ESLint prohibits the usage of React.StatelessComponent and React.FunctionalComponent within the codebase

Is there a way to restrict the use of React.StatelessComponent or React.FunctionalComponent and only allow React.FC in my code? For instance: export const ComponentOne: React.StatelessComponent<Props> = (props) => { return <....> }; export ...

Is there a method to give a webpage a subtle shimmering effect without utilizing CSS box-shadow?

Struggling to Develop a High-Performance Interface Feature I'm currently facing a challenge in coding an interface that requires a subtle and broad glow effect, similar to the example provided below: https://i.sstatic.net/E4ilD.jpg Exploration of ...

What causes the height and width properties in a div to remain unchanged even after using the zoom/scale CSS?

I'm trying to center a CSS spinner on the page, but I am struggling with making it happen. Even when scaled down by 50%, the height and width remain at 200px. <div class="center" style=""> <div class="uil-default-css" style="width: 200px ...

The states of both components are only being updated once the second event call is triggered within React

I am currently working with 2 functions in my project. One function is triggered when I type something into the search input, while the other one is called upon selecting a category. The initial values for the search and selectedCategories variables are an ...

fullpage.js supports triggering multiple onLeave and afterLoad events for different sections

I'm facing an issue while trying to incorporate multiple afterLoad and onLeave events in my fullpage.js for different sections. It seems like only the last one I set up is functional. What could be causing this problem? Interestingly, when I remove t ...

Adjust the height of the tabs bar in the Guake terminal

Is there a way to reduce the height of the tabs bar in the Guake terminal? I found a solution for GNOME terminal on this post, where they mentioned editing ~/.config/gtk-3.0/gtk.css. Is there a similar method for achieving this in Guake terminal? ...

When using the command npx create-react-app myapp, it produces a FETCH_ERROR

npm ERROR! FETCH_ERROR occurred npm ERROR! FETCH_ERROR code returned npm ERROR! Received invalid JSON response from http://registry.npmjs.org/@typescript-eslint%2fparser due to Unexpected numeric value in JSON at character position 80754 No solutions hav ...