joncodo
joncodo

Reputation: 2328

Put Text in a Small Button

.buttonVehicle{float:right; height:15px; padding:none; margin:none; text-align:center; text-indent:0; text-decoration:none; text-transform:none;}

The button appears now but not with any text inside it.

<asp:button id="btn" runat="server" CssClass="buttonVehicle" Text="..." />

Upvotes: 2

Views: 958

Answers (4)

Feuerwehrmann
Feuerwehrmann

Reputation: 149

Set the font size small enough to fit within the button I.e. font-size:8px; and the line height to an appropriate height for the font, I usually do 2px larger than the font so line-height:10px;.

Upvotes: 1

Nick Rolando
Nick Rolando

Reputation: 26177

If you want a button that small, you could make your own image that looks like your desired button, and then use asp:ImageButton. Just a thought

Upvotes: 0

Robert Beaubien
Robert Beaubien

Reputation: 3156

Try changing the padding and margin attributes in the style to 0px instead of none.

Upvotes: -1

Jamie Dixon
Jamie Dixon

Reputation: 53991

This is because the height of the button is too short.

The text is actually apearing below the button. You'll notice that if you set the height to something like 35px, the text shows again.

Upvotes: 2

Related Questions