The inconsistent sizing and spacing between browsers is causing some strange issues for me

I can't shake this feeling that it should be so straightforward. I'll include screenshots from Chrome, Firefox, and IE 11 to illustrate.

First things first, it's just a basic login form with email and password fields centered both vertically and horizontally on the page.

Here is the HTML/JAVASCRIPT Code:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PHP Builds Login</title>
<script type="text/javascript">
function validateForm()
{
    var x=document.forms["login"]["username"].value;
    if (x==null || x=="")
        {
            alert("Please fill out the username");
            return false;
        }
}   

</script>
</head>
<body>
    <section class="loginform tmr">
    <form name="login" action="index_submit" method="get" accept-charset="utf-8">
        <label for="usermail">Email: </label><br />
            <input type="email" name="usermail" placeholder="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cbb2a4beb9a5aaa6ae8baea6aaa2a7e5a8a4a6">[email protected]</a>" required><br />
        <label for="password">Password: </label><br />
            <input type="password" name="password" placeholder="password" required> <br />
            <input type="submit" value="Login">
    </form>
    </section>
</body>
</html>

CSS code (within <head>):

<style type="text/css">

html, body {
    height:100%;
    width:100%;
    margin:0px;
    background: url('images/blue_sky.jpg');  
    font-size: 12pt;
}
body {
    display:table;
    vertical-align:middle;
    text-align:center;
}
section  {
    display:table-cell;
    vertical-align:middle;
}


label {
    color: #FFFFFF;
}

.tmr:before,
.tmr:after {
    content: "";
    display: table;
}

.tmr:after {
    clear: both;
}

.tmr {
    *zoom: 1;
}
:focus {
    outline: 0;
}

.loginform input:not([type=submit]) {
    padding: 5px;
    margin-right: 10px;
    border: 1px solid rgba(0, 0, 0, 0,3);
    border-radius: 3px
    box-shadow: inset 0px 1px 3px 0pxrgba(0, 0, 0, 0.1),
                0px 1px 0px 0px rgba(250, 250, 250, 0.5);
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

.loginform input[type=submit] {
    border: 1px solid rgba(0, 0, 0, 0.3);
    background: #64c8ef; /*Old browsers */
    background: -moz-linear-gradient(top, #64c8ef 0%, #00a2e2 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottombottom, color-
stop(0%, #64c8ef), color-stop(100%, #00a2e2)); /* Chrome, Safari4+ */
    background: -webkit-linear-gradient(top, #64c8ef 0%, #00a2e2 100%); /* Chrome, Safari5.1+ */
    background: -o-linear-gradient(top, #64c8ef 0%, #00a2e2 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top, #64c8ef 0%, #00a2e2 100%); /* IE10+ */
    background: linear-gradient(to bottombottom, #64c8ef 0%, #00a2e2 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#64c8ef', endColorstr='#00a2e2', GradientType=0 ); /* IE6-9 */
    color: #fff;
    padding: 5px 15px;
    margin-right: 0;
    margin-top: 15px;
    border-radius: 3px;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
}

</style>

In Chrome, my password input is slightly off to the left, causing the inputs to not align properly.

In Firefox, everything looks spot on.

But in IE 11, the sizes are all different.

Answer №1

To ensure proper alignment of elements (as there doesn't seem to be a specific question in your post):

Make sure to eliminate the space between input:password and <br/>

<label for="password">Password: </label><br />
    <input type="password" name="password" placeholder="password" required> <br />
    <input type="submit" value="Login">
    ...

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

Play button icon is missing in Firefox when using absolute positioning

I'm currently experiencing an issue with my video gallery section. I have both normal and hover versions of a play button positioned above a preview image of a video. However, the play buttons are not visible at all in Firefox. You can view the page h ...

What are some ways to design scrollbars with a Google Wave-like style?

Is there a way to design scrollbars similar to the ones found in Google Wave? They seem to save space and have an appealing look. I am interested in implementing these customized scrollbars on a div element, just like how Google Wave utilizes them. https: ...

Creating equal spacing between divs and the edges of the container

I need to arrange a set of divs equidistant from each other. My goal is to have the maximum number of divs fit side by side with equal spacing between them and the container edge. While I almost achieved this with the code below (credit to another post), ...

Utilizing JQuery Mobile to handle multiple forms on a single page and submitting each form uniquely by its ID using JQuery Post

After experimenting with assigning the same form ID to all forms on the page and also giving each form individual IDs with unique.submit functions, I encountered an issue where only the first form would work while the rest would redirect me back to the hom ...

Tips for designing websites using HTML and CSS

current result: https://i.sstatic.net/eXLPv.png desired output: https://i.sstatic.net/vgl6z.png I am aiming to center the text. add image description here add image description here ...

Utilizing ASP.NET with JavaScript to target elements by ID within an iframe

Struggling to populate my form within an iframe by inputting a value in a textbox and selecting an option from a dropdown menu. webform1 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title ...

Is it possible to incorporate a different website font into an email template?

Currently working on an email template and looking to match the font with my website. Is there a method to ensure my site's font carries over into the email template? Provided below is the HTML code: <!DOCTYPE html> <html> <head> ...

Anticipated spatial glitch problem involving the gadicc/meteor-reactive-window package for Meteor

Utilizing the gadicc/meteor-reactive-window Meteor Package to switch templates based on screen size. This file is named pictureDisplatSection.html <template name="pictureDisplaySection"> <div class="display"> ...

Positioning of DIV elements in relation to each other

I'm currently enrolled in Codecademy's HTML & CSS course and I'm finding the topic of positioning a bit perplexing. Here is an example of my HTML file: <!DOCTYPE html> <html> <head> <style> div { pos ...

Bug in Sublime Text's Autocomplete Feature for HTML Tags

Recently, I've encountered a small bug with my Sublime Text 3. Every time I try to auto-complete certain HTML tags, an extra '<' is added before the first tag, forcing me to manually delete it each time. I'm currently using build 317 ...

Distinguishing between these two hover text types: JQuery CSS, what sets them apart?

As a total jQuery novice, I've been curious about the difference between these two types of text that appear when you hover over something. Can someone please clarify what each one is? Thank you very much. First hover text: When hovering over the up- ...

Creating a dynamic text design using Bootstrap or CSS: What's the best approach?

I attempted to enable responsive font sizes in Bootstrap 4.3.1 by setting the $enable-responsive-font-sizes variable to true, but I did not see any changes. Below is the code from my template.html file: <div class="m-2" id="role" ...

Having difficulty aligning divs in the center

My nested div is causing alignment issues and I can't seem to solve it. Despite trying various solutions like margin: 0 auto and setting a specific width, the centering problem persists. Can someone please help me identify the issue and provide a fix ...

Segment the progress bar into sections

Struggling with an Angular app, and still new to HTML and CSS, I am attempting to create a unique progress bar. I aim to split each section of the progress bar into two subsections with distinct background colors shown in this image: https://i.sstatic.net/ ...

When an excessive amount of text is added, a column begins to resemble a row

As I work on developing a practice app that involves sending messages, I've encountered a styling issue when the message length exceeds a certain limit. My scenario includes a user profile picture with the message displayed alongside it. However, whe ...

The sub-menu is being obscured by a PDF element in Internet Explorer, causing visibility issues

I have an object type tag on my page that displays a PDF file. Everything is functioning correctly, but in Internet Explorer, my sub-menu is being hidden behind the object tag. var objTag = $('<object></object>') .attr({ data: source ...

Tips for synchronizing text field and formula field content on MathQuill 0.10

I am currently working on creating a WYSIWYGish input element for my formula, along with a LaTeX input element. <span id="editable-math" class="mathquill-editable"></span> The goal is to make these two elements work synchronously. Here's ...

Make sure to define the image path in the CSS file of your WordPress project

When working on my WP 4.2 project, I encountered a situation in the CSS file where I had to write: background-image: url('/wp-content/plugins/artistssongs/images/fancybox_sprite.png'); However, I find it inconvenient to display the full path to ...

Select your vehicle from the drop-down menu

Seeking assistance with a Javascript drop-down selector for vehicle make, model, and year. The goal is to dynamically generate a link based on the user's selections. I'm struggling with implementing the year selection without replacing the model. ...

Experimenting with applying jquery .slideDown() to multiple classes in order to create dynamic animations

I am facing an issue while using .slideDown() with multiple classes. I want only one class to toggle/dropdown at a time, but currently when I press the button, all classes show up instead of just the one I want to display. How can I achieve this? Here is ...