PDA

View Full Version : how to set the size of a button



janunme
04-22-2007, 08:31 AM
hi to all

i want to set a fixed size to a button which is not expand or not reduced based on the value. is it possible

regards

djr33
04-22-2007, 08:39 AM
I think it will need to become wide enough to fit text... if will expand til it fits, at a minimum.
But... probably could use <... style="width:20px;">, or something.
//random guess... not sure.

janunme
04-22-2007, 09:15 AM
thanks for your reply


it is working.thanks for your quick reply. can you tell how to chane the color of a button. i want to display my won colored buttons. is it possible

regards

djr33
04-22-2007, 09:19 AM
I really don't know CSS that well.
Generally, CSS works better than just html, so that's why I used style="height... rather than height="..., which may have not worked.

As for color... google button colors and CSS properties.
Off the top of my head, I'd suggest as possibilities 'color' and 'border-color'. See what happens.
And remember,
style="property: #000000;"
That's for black... just change the hex code for colors.

jscheuer1
04-22-2007, 02:42 PM
Buttons are one of the hardest elements to style. The support for this varies by browser. A strict HTML 4.01 DOCTYPE helps. The color of a button (when supported) is its background-color property.

Twey
04-22-2007, 03:03 PM
You should avoid using pixels to size things wherever possible, though... the text in the button won't be visible if the user's font size is too big.

mburt
04-22-2007, 04:10 PM
In addition to that, use the according padding to enlarge it from it's current width. That will make sure the text doesn't get hidden, it just expands.