What is the best way to adjust my form to fill the entire row on a phone screen while keeping it centered on a desktop screen?

I am having difficulty making my form occupy the entire row on a phone screen/iPad screen, but start in the middle on a desktop screen. How can I adjust my bootstrap classes to achieve this?

Here is what I have tried:

<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4-offset-4">
//My Form
</div>

Outcome

The form looks good on Phone size screens

https://i.sstatic.net/wS8NU.png


The form looks awful on Desktop size screens

https://i.sstatic.net/5LDz3.png

Answer №1

Your code contains an error that needs to be fixed. The correct formatting is as follows:

<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4 col-lg-offset-4">
   //My Form
</div>

Alternatively, you can simplify it by using the following code instead:

<div class="col-xs-12 col-lg-4 col-lg-offset-4">
   //My Form
</div>

Answer №2

Swap out col-lg-4-offset-4

try using

col-lg-4 col-lg-offset-4

(specifically, one class for the container width and another for the offset)

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

Combining CSS Styles into a Single Style

Consider the following CSS styles... .Center { text-align: center; } .R { float: right; } #TopImage { background: #0ff; } To apply all three styles to an element, simply do this: <div class="R Center" id="TopImage"> If using this combination of s ...

Staging a div from a specific origin

On my HTML page, there is one div and a small round image. Initially, the div has a scale of 0 so it is not displayed. However, when I click on the small image, the div scales to 1 in the middle of the window. The position of my div is absolute. My issue n ...

Adding an attribute to the last item of an Angular / NGX Bootstrap component

I am working with a dynamic list that utilizes NGX Bootstrap Dropdowns to showcase 4 sets of dropdown lists. However, the Dropdowns in the final list are getting obscured off-page. Thankfully, NGX Bootstrap offers a solution in the form of a dropUp option ...

What steps can I take to deactivate input and stop it from being accessible on the browser?

insert image description Is there a method to block users from accessing disabled input fields in the browser? Any recommendations or solutions would be greatly appreciated. Vuejs is utilized within my project. Implementing this feature serves as a secu ...

How can I ensure that my page is centered when viewed on a mobile device?

As I strive to enhance the responsiveness of my webpage, I opted for utilizing Bootstrap. However, upon viewing the page on a mobile device such as an iPhone 6/7/8, I noticed that all the content is aligned to the left side of the screen. My intention is t ...

The speed at which Angular is hiding elements is too rapid for any animation to keep up with

Utilizing Angular 1.2 in conjunction with the animate.css library available at The animations I'm implementing are geared towards simple ng-show="somevalue". The ng-show animations are functioning properly, smoothly fading in. However, when the eleme ...

Troubleshooting Issue with InfoWindow Display on Multiple Markers in Google Maps

I'm having trouble getting my markers to show different infowindows. No matter what I do, the markers always display the content of the last "contentString" in the loop. Despite reading through multiple posts on this issue, I haven't been able t ...

Animation effects for a menu using jQuery

I am in the process of creating a website and I have incorporated jQuery to add animation to a horizontal tabbed menu. The effect that I am aiming for can be viewed here: / link removed / When you hover over the "Link 1" tab, you will notice a white div ...

What is the best way to insert a JavaScript button before an HTML button on a webpage?

Currently, I am working on creating a calculator using JavaScript and HTML. My goal is to add memory buttons (MS, MC, MR) before the clear button (C) on the calculator interface. Despite trying various methods, I am facing some challenges in achieving this ...

Generate random unique values from an array to populate a text input field in HTML. Display a message once all unique values have been shown

I have included an option code and text box below: <select id="sel" class="form-control input-lg" data-live-search="true"> <option value="">-- Choose Your Country--</option> </select><br/><br/><br/> &l ...

What adjustments can be made to alter the height of the borders on the left and right side of the block quote, and link the border to a different div element

Block Quote Example I'm looking to create a blockquote that resembles the image provided. I have successfully implemented the top and bottom gradients, but am facing challenges with the left and right borders as well as rounding the quotations more. ...

A guide on retrieving nested data from an HTML table

Seeking assistance because I am utilizing the library Tabulator in my Laravel project and encountering difficulties manipulating nested data. In order to load an HTML Tabulator Table, it must be done through an HTML Table along with an array of objects on ...

Is there a way to input an array into an HTML input field?

Spent the entire day working on this. HTML Code <label>Input values</label> <input type="text" id="arrays" placeholder="Enter Array" > <button id="objectify" type= "button">Click</button> <div ...

Exclude strong tag inside div using Jsoup Select

Here is a sample of HTML code: <div class="address"> <strong>John Doe </strong> <br>Main Street 5 <br>12345 Anytown </div> This is the code snippet I am using: html = html.r ...

Having trouble with AngularJS not rendering on your HTML page?

This question has probably been asked countless times, but I'm genuinely unsure about what I'm doing wrong. The solutions I've come across so far haven't fixed the issue for me. Just to provide some context, I'm currently followin ...

Checking the size of an HTML numerical input field?

When creating a form that accepts numbers, there may be a specific element, such as a phone number input named phNo, that needs to be exactly 7 digits long. To achieve this validation using JavaScript, the approach is: If the length of the element is not ...

Is it possible to display HTML content in a UITextView on an iPhone?

One alternative method for displaying HTML content within a UITextView is the use of the private API setContentToHTMLString, but utilizing this may lead to rejection by Apple. Is there a workaround available to set content as an HTML string without direc ...

Changing the position of the checkbox label to be above the checkbox

Can you help me with rearranging the checkbox label position to be above the checkbox instead of on the left side? I currently have the labels appearing on the left-hand side of the checkboxes, but I would like them to be positioned above the checkboxes. ...

Issues with the loading and display of Bootstrap Carousels

Hey there! I'm facing an issue with implementing a Bootstrap carousel on my website. Despite trying out several examples from Bootsnip and even the one from the official Bootstrap website, the carousel slides are not working as expected. Any ideas on ...

Presenting information on an HTML webpage using the slidetoogle feature

< script > $(document).ready(function() { $("#flip").click(function() { $("#panel").slideToggle("fast"); }); }); < /script> When a button in a particular panel is clicked, I aim to display the details of that specific tuple ...