Divergent Appearance of Input Field in Chrome versus Firefox

After testing in Chrome and Firefox, I noticed that the input box appears larger than expected in Firefox.

Below is the HTML markup:

<div class="form-wrapper">           
    <input type="search" name="Ofsearch"
            placeholder="Search here..." value=""/> 
    <button id="searchButton" type="submit">
        Search
    </button>
</div>

And here is the corresponding CSS:

.form-wrapper {
     height: 80px;
     clear: both;
}

.form-wrapper input {
     border-radius: 10px;
     border: 5px solid #E5E4E2;
     margin: 2px;
     height: 40px;
     vertical-align: middle;
     padding: 20px;
     margin-top: 15px;
     width: 85%;
}

.form-wrapper button {
     overflow: visible;
     position: absolute;
     float: right;
     border: 0;
     padding: 0;
     height: 40px;
     width: 110px;
     border-radius: 0 3px 3px 0;
     margin: 20px -118px;
}

For a visual representation, you can view the example here.

Upon investigating, I discovered that the padding:20px in .form-wrapper input{ } is causing the discrepancies in size between Chrome and Firefox. Removing it fixes the issue in Firefox but results in a smaller input area in Chrome. Is there a way to ensure consistency across both browsers with regards to the display?

Answer №1

One reason for the difference is that Firefox applies box-sizing: content-box to type="search" inputs, while Chrome uses border-box.

.form-wrapper input {
    box-sizing: border-box;
}

Check out this demo

Answer №2

Here is a helpful link that may address your question: Exploring form padding variations in Firefox, Opera, Chrome, and IE

Various browsers interpret attributes such as padding and borders with different initial values

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

After the submit button is disabled, the form fails to be submitted

Hello, I am having an issue with disabling my button after the form is submitted. The button gets disabled, but the PHP code does not execute. I have tried various scripts from the internet, but they all seem to have the same result: the button gets disab ...

Problem with CSS animations in IE10

I've encountered a problem with a specific section of a website I created. This section functions perfectly on all browsers and older versions of Internet Explorer, but not on the latest versions. It seems that IE no longer supports [IF] statements in ...

What are the steps to ensure my header spans the full width on both mobile and desktop platforms in an HTML email?

Hello, I am nearly finished with composing this email, but an issue has arisen on mobile where the header is not stretching to full width. My goal is to make the header image fill the entire width of the screen on a mobile device, but I keep encountering o ...

Unable to click on links due to issues with the CSS and HTML

On my page at , there are links on the right side that I am unable to click. Does anyone know why this might be happening? Content on the Left Side: <nav class="woocommerce-breadcrumb" itemprop="breadcrumb"><a class="home" href="http://artendije ...

Achieving a seamless integration of a navbar and video in Bootstrap 5.3: tips and tricks

I'm updating a website design using Bootstrap and I want to create a navbar with a video playing in the background. To ensure that the navbar stays fixed at the top while scrolling, I made it sticky. After testing various methods, I managed to posit ...

Can you show me the way to open a single card?

Can someone assist me in making it so only one card opens when clicked, rather than all of them opening at once? Additionally, if there is already an open card and I click on another one, the currently open card should close automatically. If you have any ...

There are no errors with PHP and it fails to insert any entries into the database

I am struggling to save secq (secret question) and seca (secret answer) in the database. Even though I don't encounter any errors during the registration process, the values of the variables are successfully passed through POST when echoed. Despite ...

Tips for updating the selected value in Vue dynamically

I am currently working on a feature where the months change dynamically based on the selection made using Vue. You can view the code snippet in the link provided below. <div id="app"> <span class="selectboxWrap"> < ...

What is the best way to create a dropdown menu that smoothly slides in from the bottom of the screen?

Is it possible to create dropdown menus in the navigation bar that slide in from the bottom with a smooth transition effect, similar to this example: Although I am working on building my own template, so my code may differ from the original theme. Here is ...

Interactive Gridview feature enables users to rearrange data elements easily by dragging and dropping them into desired

Currently, I am working on a sample project involving the drag and drop functionality of a grid view that allows users to reorder data. My main challenge is figuring out how to retrieve the data from the first column in the order that the user has changed ...

Responsive design involves ensuring that web elements such as divs are properly aligned

I am currently working on aligning 2 divs in a specific way that is responsive. I would like the right div to stack on top of the left div when the screen width reaches a certain point, as opposed to them both taking up 50% of the container's width. ...

Conceal the background of the lower div when the top div is displayed

I am struggling to figure out how to achieve this, or if it can even be done: <body> has a background image <div parent> has a background image <div child></div> does not have a background </div> My goal is to make the chi ...

Flipped the dimensions of an image for better responsiveness

Trying to implement this particular design on a responsive website. Wondering if there's a way to establish an inverse resizing technique using jQuery / Javascript so that as the viewport shrinks, the text size increases. Attempted to use jQuery to a ...

Organize Radio Selectors

My intention was to align the radio buttons as shown in the image below: https://i.stack.imgur.com/oPTjD.jpg However, the final result looked like this https://i.stack.imgur.com/Mixga.jpg Below is the code for your reference HTML <div class="form ...

Fancybox overlay not adjusting to full height

When working with JavaScript: $(document).ready(function() { $(".fancybox").fancybox({ helpers: { overlay: { opacity: 0.4, css: { 'background-color': '#FFF' ...

Displaying article title above container with backdrop picture

Currently, I am working on a specific layout design using Bootstrap 5 where I am trying to render a tag outside its original container so that it takes up the full width of the page. My attempts with absolute positioning on the img tag have proven to be ch ...

Why doesn't "align-self: flex-end" relocate the game board to the bottom of the screen?

Hey there, I am currently working on developing a Connect 4 game and have decided to use a table for the board. To position the board properly, I am utilizing flexbox. Although I have specified align-items as 'flex-end' in order to bring it to th ...

Can you please explain the primary distinction between these two identification numbers?

Can you explain the distinction between the following two css ids? p#id1 { insert code here } and #id1 p { insert code here } ...

Positioning Images in Bootstrap 4

I'm encountering an issue with Bootstrap 4. The left box isn't aligning properly with the right box. This involves both HTML and CSS. How can I go about resolving this issue? <section> <div class="container"> <div class="row"& ...

Is there a translation issue affecting Chrome version 44?

Recently, Chrome 44 (44.0.2403.89 m) was released and I've encountered some issues with the translate3d feature (on both Mac and Windows versions). This problem is impacting plugins such as fullPage.js and consequently affecting numerous pages at th ...