-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to force the label of a Button to wrap text? Here's a snippet out of the Live Demo->Forms and Inputs->Buttons page that I changed and re-ran:
<button label="Above with some really long text" image="/img/Centigrade-Widget-Icons/ArrowUp-16x16.png"
hoverImage="/img/Centigrade-Widget-Icons/ArrowUpGreen-16x16.png" orient="vertical" width="125px" />
The label gets clipped after the word "some". I would like to have a multiline label. I have a real app that I've done this with using some fixed width buttons. It seems that, no matter what my width, I always have some text too long for the button.
Any suggestions?
Thanks,
Cary
Hi
Maybe there is an easier way (i am new in CSS) , but i use this:
I add white-space: pre; to the style. I named my sclass "icon" and use it in the button.
<style>
.icon, .icon .z-button-cm {
font-family: ${fontFamilyT};
font-size: ${fontSizeM}; color: blue;
cursor: pointer; white-space: pre;
}
....
</style>
<space width="150px"/>
<button id="newbox" image="/images/LadePlus_32.png" orient="vertical"
label="Enter
new Box" sclass="icon"/>
See the result here (the menubar are simple buttons with some style).
Note: The Visual Editor ignores my linebreak. If you create your button form java use "Enter\nnew Box".
/Robert
Thanks Robert! I had to change the white-space to pre-wrap, but that made it work great!
Cary
It doesn't work for me.
My version is:
ZK Packages: 3.6.2
Which version you have been working on?
Thanks.
Asked: 2009-02-17 16:08:59 +0800
Seen: 326 times
Last updated: Jul 31 '09