adjust and align the input controls

Can you provide suggestions on how to align the 4 buttons vertically and resize them to be 50% in width and 20% in height relative to the browser's dimensions, while ensuring that the remaining 20% of height is evenly distributed between the buttons?

Answer №1

Take a look at this demo: http://jsfiddle.net/dj2fu/

To achieve the desired result, you'll need to make a few adjustments.

Firstly, eliminate the <br> tags from your code.

Next, add the following CSS styles:

html, body {
    min-height: 100%;
    position: relative;
    height: 100%;
    padding: 0;
    margin: 0;
}
#divMainMenu {
    margin: auto;
    height: 100%;
    width: 100%;
    display: table;
}
#divMainMenu input[type="button"] {
    display: block;
    width: 50%;
    margin: auto;
    height: 20%;
    margin-bottom: 2.5%;
    padding: 0;
    margin-top: 2.5%;
}​

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

Containers with the ability to adjust based on screen

As I incorporate Bootstrap 4 into my project, I have come across the need for a more specialized solution specifically for search results. While exploring options, I stumbled upon an interesting project that allows the use of responsive containers tailored ...

Having trouble loading CSS file in node js after submitting form

Before diving into more details, let me explain my current situation. I am utilizing node's nodemailer to facilitate the process of sending emails based on the information submitted through a form. Initially, everything was functioning smoothly when t ...

Incorporating a vertical slider alongside a fullPage.js section for a dynamic user experience

Is there a way to achieve a transition effect similar to this example for fullPage.js section-elements? <div id="fullpage"> <div class="section"></div> <div class="section"></div> </div> I have experimented with var ...

I'm struggling to make a div stretch across the full width of the screen

Despite my efforts, I can't seem to eliminate the noticeable margin between the div and the edges of the screen. <!DOCTYPE html> <html> <head> <title>Test2</title> <link rel="stylesheet" href="https://maxc ...

When scrolling on IOS devices, the fixed element gets hidden underneath the lower element

During the development of my web H5 app, I encountered a technical issue. The fixed element 'Header' is getting covered by a lower element on IOS devices when I drag down the lower element, but it works fine on Android devices. Here is an image ...

Clickable PDF Button for Quick Website Access

Is there a way to create a button on an HTML page that remains functional when the page is saved as a PDF? I want the button to link to a webpage so that users can click on it in the PDF and be redirected to the link. ...

A method for merging the values of three text fields and submitting them to a hidden text field

<label class="textRight label95 select205">Cost Center: </label> <input type="hidden" name="label_0" value="Cost Center" /> <input type="text" name="value_0" class="input64 inputTxtGray" value="" maxlength="10" /> <input type=" ...

Utilizing CSS3 Animation for enhanced hover effects

I have a setup with two divs. One of the divs expands in height when I hover over it. What I'm trying to achieve is to display text with a fade-in effect somewhere on the screen when I hover over that specific div. Additionally, I want to show another ...

Selenium is having trouble reading the text from a dropdown that has the autocomplete feature disabled

It seems that Selenium is having trouble retrieving the text from the dropdown options. Here is a snippet of the code I am working on: WebElement dropdown=driver.findElement(By.id("selFromAccount")); List<WebElement> dropoptions=dropdown.findElemen ...

Utilizing ngModel within a nested ngFor loop in Angular to capture changing values dynamically

I have been working on developing a screen using Angular and I'm facing an issue with binding values using ngModel. https://i.sstatic.net/DCJ3T.png Here is my implementation. Any help would be appreciated. The model entity I am using for binding the ...

How can you make divs adapt to screen resizing in a similar way to images?

In my REACT project, I am faced with the challenge of positioning three divs next to each other, with a small margin between them, and ensuring they are horizontally centered on the screen. As the screen width decreases, I need the right-most div to move ...

When text refuses to wrap, it ends up disrupting the layout

In my collection of div rows with variable width inside a resizable container, I'm encountering an issue with a hanging indent. The problem arises when the width is too low, causing the first line to be pushed beneath the red label. At 450px, everyth ...

Tips for repurposing a "for" variable in Django

I'm attempting to present my data frame in a table on my web application without using .tohtml because I require a dynamic table. However, it seems that I am unable to utilize the key/column variable from my loop: <table id='bdd_table'> ...

What is the best way to align a form in the center of a page both horizontally and vertically

Currently, this is the HTML code I am working with: <body> <form id="form_login"> <p> <input type="text" id="username" placeholder="username" /> </p> ...

Transmit information to php script using an html document format

Is there a way to load the file table.php with the data that I am trying to pass when the ajax call is made? I have attempted to do this using the jquery.load method, where the second parameter is a data array, but it doesn't seem to be working. Here ...

"Marquee animation functions correctly on the emulator but fails to display on the physical

Greetings! I recently incorporated a marquee tag into my application, and it functions properly in the Android simulator. However, once I install it on my device, the marquee does not display. Below is the code I used for the marquee: <marquee behavi ...

Embed HTML code to a website using a PHP script on a separate webpage

As a newcomer to PHP, I may have a silly question. Let's say I have a form: <form id="createNewGallery" name="newgallery" method="GET" action="code.php"><p><strong>please choose the number of pictures you want to upload: </str ...

Guide to switch background image using querySelector

I am currently trying to figure out how to set the background image of a div block by using querySelector. I have attempted various methods in my test code below, but unfortunately none seem to be working. Can someone please provide assistance? <!DOC ...

How to import a template from a different webpage in AngularJS

I have a situation where I need to include a template from one HTML page into another because they are both lengthy and it's not practical to keep them on the same page. Therefore, I have decided to separate them for better organization. Here is an ov ...

What could be causing the "Cannot POST /api/" error to occur when attempting to submit a form?

Having issues with my basic website and struggling to find a solution. As a complete beginner in this field, I am stuck and need some guidance. Accessing http://localhost:3000/class/create works perfectly fine when running the server. However, trying to a ...