Enhancing the padding of submit buttons in Mac OS X

I'm struggling to apply padding to a submit button. I have created a simple example in a JSFiddle:

http://jsfiddle.net/yxr197pa/1/

Below is the code for it:

HTML:

<input type="submit" value="Submit" />

CSS:

input {
    padding: 20px;
}

I seem to be missing something really basic, and I am a bit embarrassed that I can't solve this issue on my own. Despite extensive searching, it seems like no one else is facing this problem as I've searched quite thoroughly. I've even come across examples of people adding padding without any trouble. Any assistance would be greatly appreciated. Thank you!

Update

To clarify the problem for those who might be confused by my query: the above code does not change the padding of the button at all. It appears that default padding is applied to the button, but the specified padding simply does not appear. Here's an image illustrating what I see when I input the code above:

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

This issue has been resolved in a response below, but the root cause remains unclear to me. It seems to be related to my computer setup. I am using an up-to-date Mac OS X. On the other hand, my PC displays the example above perfectly fine. The browser used on my Mac does not affect the rendering of the specified padding either.

However, after examining source code from other websites, I discovered submit buttons that display padding correctly on my Mac, despite having virtually identical code. Check out this link for an example:

So why does the padding show sometimes and not others?

Answer №1

As per the discussions above, it was mentioned that you are using a Mac (OS X)..

It is necessary to adjust the appearance property of the input element to none to enable padding. Additionally, I have included vendor prefixed properties such as -webkit and -moz:

input {
  padding: 20px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
<input type="submit" value="Submit" />

This issue appears to be one of those peculiar cross-browser inconsistencies, as it does not seem to occur on Windows operating systems.

Answer №2

From my observation, it appears that adding padding to an input is not possible.

In my opinion, the closest alternative would be to adjust the height and width of the input instead.

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

Is there a JavaScript function available to remove comments from previously commented HTML code?

<div id="div1">bar</div> JQuery function addComment(element){ element.wrap(function() { return '<!--' + this.outerHTML + '"-->'; }); } addComment($('#div1')); Looking for assistance in unc ...

Web Essentials is experiencing a problem with minified CSS

Today, while using Web Essentials 2013 for Update 3 with Visual Studio Express 2013 for Web, I encountered an issue with the minified CSS file. The website I am currently working on is built on a Twitter Bootstrap platform and utilizes two separate CSS fil ...

Creating a bespoke Bootstrap 4 Modal experience without the backdrop

I'm attempting to show a Bootstrap 4 modal without a backdrop. I've tried the following code with no success: .modal.right. modal-backdrop.show { background-color: transparent !important; } When I try this modification, it works (but affect ...

The positioning of the navbar is impacted by the float property of an element within a separate div

Currently, I am working on coding a basic website layout that includes a navigation bar positioned under the header. The issue I am facing is that the alignment of the navbar items depends directly on the length of the header element, but only when the hea ...

Sending Image Data in Base64 Format with Ajax - Dealing with Truncated Data

My current challenge involves sending Base64 image data through ajax to the Server. I've noticed that sometimes all the pictures are successfully sent, but other times only a few make it through. Does anyone have suggestions on how to implement error ...

Minimal Space Separating Footer Division and Body Element

While there are numerous discussions online about fixing footer alignment issues, I've encountered a unique problem that needs addressing. The issue at hand is a 29px gap between the bottom of the footer and the <body> tag on my webpage, which ...

The alignment of justify-space-around and justify-content-center in Bootstrap 4 appears to be misaligned

I've been struggling to find a solution to this issue. My goal is to align the centered elements between two lines, similar to what Bootstrap's documentation shows. There doesn't appear to be any excess margin or padding causing alignment is ...

Switching Bootstrap Navbar Active State with JavaScript

I have encountered an issue with using the "active" class on my navbar navigation items in Bootstrap 4. When I click on the links, the active state does not switch as intended. I have tried incorporating JavaScript solutions from similar questions but have ...

What is the best way to soften the background image without losing its sharp edges?

Take a look at the desired effect in my mockup. I have successfully masked an image to a button within my form However, when I apply a blur to the background-image, the edges of my button become too soft, which is not what I want. Is there a way to keep ...

Is there a way to insert a record upon the user clicking on the Add Record button?

// Here is my Component code // I want to figure out how to add a new row to the table with fresh values. import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-uom', templateUrl: './uom.component.html ...

Strange CSS/browser storage glitch

UPDATE: JUST REALIZED THIS ISSUE IS ONLY OCCURRING ON FIREFOX, NOT CHROME ANOTHER UPDATE: Oddly enough, this problem only occurs locally. When I push it to GitHub, everything works fine. So strange. I suppose that means it's not a major issue. On my ...

Tips for populating a form in CasperJS by referencing the form name

Struggling to populate the fields in a form: <form name="step_one_login_form" action="/" method="post"> <input type="hidden" name="form_name" value="step_one_login_form"> <input type="hidden" name="return_url" value="index.php? <di ...

Keeping everything aligned, my aim is to position the search bar and the logo side by side on the left-hand side and stretch the search bar all the way to the end

Looking to adjust the placement of the logo and search bar on the left side while extending the search bar further to the right. Struggling to get the desired layout? No worries, we've got you covered! Also need a join and log in button aligned to the ...

OutOfMemoryError caused by Bitmap

I'm experiencing an issue with this error. I created a favicon parser from URLs using the following code: public class FavIconParser { public static String extractUrl(String url) { StringBuffer sb = new StringBuffer(); Pattern p = Pattern.co ...

A div element appears without any height if there is an image contained within it

I am facing a challenge with a div[div1] that contains other elements. The elements inside have an absolute positioned image, and both div1 and the elements have a float left property without showing any height. Is there a solution to give div1 a height so ...

Enhance Your Navbar in Bootstrap 3 by Creating Vertically Expanding Links Relative to Brand Image Dimensions

To best illustrate my issue, I will begin with a screenshot of the problem and then explain what I aim to achieve. Here is the current state of my navbar: Currently, the text of the links on the right side is positioned at the top. Additionally, this is h ...

Utilize Bootstrap 4 to seamlessly switch between nav-pills for larger screens and navbar-nav for smaller screens

On larger screens, I prefer the appearance of the nav pills. However, once the collapse button appears, I would like the menu to stack and resemble the image provided instead of the pills. Do I require custom CSS to achieve this? <div id="menu" class=" ...

Enhance the appearance of Font Awesome stars by incorporating a hover effect

Is there a straightforward way to make them turn solid yellow when you hover over them? const styles = theme => ({ root: { flexGrow: 1, overflow: 'hidden', padding: theme.spacing(0, 3), }, paper: { maxWidth: 800, mar ...

Is it possible to make a div's width 100% until a certain point, and then change it to 30% beyond that breakpoint?

I am trying to work with a div element <body style="width: 100vw; height: 100vh"> <div id="containerDiv"> <div id="canvasDiv" /> </div> </body> My goal is to adjust the width of canvasDiv based on the screen size. ...

The left menu icons transform upon mouseover interaction

Is there a way to dynamically change the image displayed in the left menu when hovering over it, similar to the example shown below? https://i.stack.imgur.com/HzGwR.png Currently, the image does not change on hover. We would like it to transition into a ...