Hi I don\'t want an image for my submit button so I have gone with the default submit button but I want to edit its width and height. How do I do that?
just use style attribute with height and width option
<input type="submit" id="search" value="Search" style="height:50px; width:50px" />
You can change height and width with css:
#search {
height: 100px;
width: 400px;
}
It's worth pointing out that safari on OSX ignores most input button styles, however.
Using CSS.
Either inside your <head>
tag (the #search
means "the element with an ID of search
")
<style type="text/css">
input#search
{
width: 20px;
height: 20px;
}
</style>
Or inline, in your <input>
tag
<input type="submit" id="search" value="Search" style="width: 20px; height: 20px;" />
That's easy!
First, give your button an id
such as <input type="button" value="I am a button!" id="myButton" />
Then, for height, and width, use CSS code:
.myButton {
width: 100px;
height: 100px;
}
You could also do this CSS:
input[type="button"] {
width: 100px;
height: 100px;
}
But that would affect all the buttons on the Page.
Working example - JSfiddle