I just noticed this strange rendering of a very simple form.
Here's my markup/CSS: http://jsfiddle.net/a9PLM/
As you can see, text fields and the button share the same styles but their size is quite different.
Why does this happen?
Thanks!
Editing the size of a button in HTML is relatively easy. In the simplest form you just have to add a 'style' attribute to the button element containing your desired height and width values in pixels. It goes something like this. Alternatively, you can add a 'class' to button and add your styles in a CSS file.
The simplest way to do this is by using the WordPress CSS Editor. To open this, go to Appearance » Customize and select Additional CSS. Once you've opened the Additional CSS section, you can paste in your new CSS, click the Save & Publish button, and you're all set!
You shouldn't try to place a button inside a textarea, that's doesn't make sense semantically and shouldn't be done. You could do what you're currently doing: positioning the button on top of the textarea in the right place.
An <input type="submit"> element's value attribute contains a string which is displayed as the button's label. Buttons do not have a true value otherwise.
This is because of the box model being used is different for the <input type="submit">
and the <input type="text">
/<textarea>
. You can make the box models the same by specifying them with CSS:
box-sizing: border-box;
-moz-box-sizing: border-box;
You can read more about box models here: http://www.quirksmode.org/css/box.html
I edited your jsFiddle to show it working: jsFiddle demo
I think this is a browser rendering issue... with buttons being displayed differently than text inputs.
To fix, add this to your css
form input[type="submit"]{
width:273px;
}
Example: http://jsfiddle.net/jasongennaro/a9PLM/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With