Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button Size 2

Status
Not open for further replies.

shultz

Programmer
Oct 28, 2001
42
HK
How can I resize a button. If I want my button to span certain number of pixels in width and height, how can I do that.
thanks
 
You can put width and height attributes in your tag but that only works for Netscape:
Code:
<input type=&quot;submit&quot; value=&quot;submit&quot; width=&quot;20&quot; height=&quot;30&quot;>
Note that if the button needs to be bigger than you specify in order to fit the text in, it will resize it anyway.

The only way to be absolutely sure about pixel sizes is to make an image of a button and use
Code:
<input type=&quot;image&quot;>
to submit your form. You can even make a button that looks just like browser buttons if you want and no one will be the wiser.

Good luck!
 
could you use style width and height attributes?

<input type=submit value=submit style=&quot;width:200; height:399;&quot;> Robert Carpenter
questions? comments? thanks? email me!
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
Glowball and theEclipse are both right.
This is what works for IE and NN (I only can test in IE4.0 and NN4.73)

only NN
<INPUT TYPE=&quot;submit&quot; width=&quot;200&quot; height=&quot;40&quot; name=&quot;buttonNN&quot; value=&quot;buttonvalue NN&quot;><br>

only IE
<INPUT TYPE=&quot;submit&quot; style=&quot;width:200px; height:40px;&quot; name=&quot;buttonIE&quot; value=&quot;buttonvalue IE&quot;><br>

IE + NN
<INPUT TYPE=&quot;submit&quot; width=&quot;200&quot; height=&quot;40&quot; style=&quot;width:200px; height:40px;&quot; name=&quot;buttonIENN&quot; value=&quot;buttonvalue IE + NN&quot;><br>

Some other CSS properties work for IE + NN
(I don't know all so, try other properties)
<INPUT TYPE=&quot;submit&quot; width=&quot;200&quot; height=&quot;40&quot; style=&quot;font-size:70%; font-style:italic; text-decoration: underline; Font-Family: times new roman; width:200px; height:40px;&quot; name=&quot;buttonIENN2&quot; value=&quot;buttonvalue IE + NN nr.2&quot;><br>

Hope this helps,
Erik
 
I've tried using
Code:
style=&quot;padding:5px&quot;
on buttons and it works fine in IE, but in NS4.7 it not only doesn't work, but for some reason forces each button to be on it's own line (i.e. they end up stacked vertically)! When is that outmoded piece of software junk going to finally die so we don't have to worry about it any more?
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
I agree with dilettante! stop supporting netscape under 6-0 Robert Carpenter
questions? comments? thanks? email me!
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
I don't support NS4.7 if I don't have to. The page where the buttons ended up stacked vertically under NS4.7 looks just like that - they're stacked vertically. I like the way it looks under IE5.5+ and I'm not going to mess up a great layout just to accomodate a piece of outdated, outmoded junk.

My boss is beginning to feel the same way. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
LOL Robert Carpenter
questions? comments? thanks? email me!
eclipse_web@hotmail.com
Icq: 124408594
online.dll

AIM & MSN: robacarp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top