Chrome shows different height for various input types such as time and number

Having some trouble with input elements of different types and varying heights. For example, in Chrome the input type "time" appears taller than type "number." See the simplified illustration here: http://jsfiddle.net/4jteqy1f/

HTML

<article class="settings">
    <ul>
        <li>
            <input type="time" value="00:00">
        </li>
        <li>
            <input type="time" value="00:00">
        </li>
        <li>
            <input type="number" value="286">
        </li>
    </ul>
</article>

CSS

.settings ul li{
    display: inline-block;
    padding:5px;
    background-color: #dee7f8;
}

In this demonstration, the input of type "number" appears smaller compared to other input fields, especially in Chrome. However, it displays correctly in the latest Internet Explorer version. What could be causing this discrepancy and what are the possible solutions?

Answer №1

If you want to adjust the styling of your input elements, you can include the following CSS code:

input{padding: 0 0 0 3px; height: 20px; vertical-align: middle;}

The key concept here is to create enough space for the up and down buttons by setting the height to 20px, and using vertical-align: middle to center the text within the input field (this won't impact the appearance of the arrows themselves)

Feel free to explore the code provided above and experiment with different sizes to see how it affects the layout

.settings div li{
display: inline-block;
    padding:5px;
background-color: #dee7f8;
}
input{padding: 0 0 0 3px; height: 20px; vertical-align: middle;}
<article class="settings">
    <div>
        <li>
            <input type="time" value="00:00">
        </li>
        <li>
            <input type="time" value="00:00">
        </li>
        <li>
            <input value="286">
        </li>
    </div>
</article>

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

I recently ran npm install --save bootstrap and now I am unable to locate the bootstrap.min.css file anywhere

Trying to follow a tutorial based on a video, I'm running into an issue where I can't locate the bootstrap.min.css file mentioned. Despite searching online, I haven't found any relevant information. The files I have access to are: https://i ...

Why does the appearance of my PHP spreadsheet change when I attempt to print it?

After using a CSS stylesheet to position my textboxes correctly, I noticed that in Chrome everything appeared fine. However, when attempting to print the site (Ctrl+P), each sentence and textbox shifted. How can I ensure they remain in place? <!-- #cap ...

What is the best method for embedding Microdata or JSON-LD for an ebook in SVG image format within an HTML5 document?

Recently, I came across Schema.org and am interested in implementing it on my webpages. However, due to time constraints, I haven't been able to delve deep into understanding it fully yet. The issue at hand involves converting a 670-page PDF book wit ...

extra elements within the 'navbar-toggler' icon button

How to create a navbar with multiple menu items that are always visible? Some items will be shown upon clicking the navbar button, while others will remain steady. Using the bootstrap navbar-toggler button can make the navbar longer when adding more items ...

Adjust the size of the images in the Bootstrap navbar brand to make them resizable and move them

After some online research, I discovered a method to create a two-row Bootstrap navbar with the navbar-brand on its own row: <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBn ...

The jQuery Remove function that went haywire

Currently, I am delving into the world of Javascript/jQuery and attempting to construct a list of items in a table based on user input. The concept is simple - a user types text into a form, the JavaScript/jQuery captures that input and showcases it as a ...

Variations in CSS Stylesheets for Various Parts of the Body

Currently, I am in the process of creating a single page website. One issue that I have encountered is needing a Bootstrap "modal" class popup to appear when a button is clicked. However, the template I am utilizing was designed using Bootstrap Version 1, ...

What is the best way to link a Nav.Link to an ".html" webpage?

My website has a react navbar, but I am encountering issues when trying to redirect the page to an .html file. Here is the code snippet of the component I am using, with the href reference pointing to the QR CODE page at the same level as the component pa ...

Is there a way to create a two-toned horizontal rule tag?

Looking for a way to create a stylish two-toned divider line at the bottom of my header. It should be two pixels tall, with a grey top half and white bottom half. While I considered using two one pixel divs stacked together, I'm hoping there's a ...

What is the method for assigning a class name to a child element within a parent element?

<custom-img class="decrease-item" img-src="images/minus-green.svg" @click="event => callDecreaseItem(event, itemId)" /> Here we have the code snippet where an image component is being referenced. <template&g ...

Arranging div elements with CSS styling

I always struggle with CSS layouts and positioning 'div' elements on the page. For instance, I have created the following structure: Check out my jsfiddle: http://jsfiddle.net/JJw7c/3/ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiona ...

Switching the class for the pseudo-element :after

Consider a scenario where there is a button: <button href="#" class="search no-style search-active" style="display: inline-block;"> <div class="pointer" style="display:none">::after</div> </button> Upon activation of the button, ...

What is the best way to transfer data between HTML files using Python?

Is it possible to pass values from one HTML file to another and then retrieve those values in the second HTML file? This is the code I am currently using: with open('page.html', 'w') as myFile: myFile.write('<html>&apo ...

In IE8, the :last-child pseudo-class appears to be ineffective

Here is the HTML structure I am working with: <div class="footerMenu"> <ul> <li>Home</li> <li>About</li> <li>Feedback</li> <li>Contact us</li> </ul> ...

The functionality of scrolling ceases to work once the bootstrap modal is closed

I am utilizing Bootstrap v3.1.1 to showcase a modal popup on one of my web pages. The following code shows how I have implemented it. <!--Start show add student popup here --> <div class="modal fade" id="add-student" tabindex="-1" role="dialog" a ...

The vertical overflow feature does not seem to be functioning correctly with the

In the following HTML setup: <div id="container"> <header></header> <div id="content"> <div class="something"></div> <div class="lateralInfo"> <div class="menu"></div> < ...

Ways to eliminate the dotted line from the image map in Internet Explorer 11

Below you will find the code I am working with: <img alt="Testing 2015" border="0" src="images/Test-2015.jpg" usemap="#Map" /> <p><map name="Map"><area coords="790,100,653,135" href="http://www.google.com/" shape="rect" style="cursor ...

What's the reason for the element not inheriting margins from its parent?

I am facing an issue with centering an h1 header within a .banner element. When I try to apply margin to the header, it appears to indent not from the top border of the banner, but rather from the nav element located above the banner. After inspecting the ...

Challenges in designing a 2-column layout using CSS

I am currently experiencing a layout problem with styling on a particular webpage and I cannot seem to figure out the cause of it. The page in question can be found at The issue arises when the page loads, at the bottom there are two sections - one displ ...

Is it possible to create a dynamic <hr /> using Flexbox?

In the midst of working on my application, I managed to achieve a simple layout. However, there is one peculiar requirement that has been eluding me for the past 2 days and now I find myself in need of assistance. Here is the current HTML code I am workin ...