开发者

JSF commandbutton - styling

Is it possible to style JSF commandbutton tags to look like th开发者_开发技巧e following example:

http://www.bloggerswatch.com/internet/css-trick-submit-button-should-look-same-everywhere/

It works for the commandlink/


Yes, you should be able to do something similar using slightly different CSS that incorporates the images as CSS backgrounds rather than <img> tags:

Markup

<div class="buttons">
    <h:commandButton value="Button Text" styleClass="apply"/>
    <h:commandButton value="Button Text" styleClass="cross"/>
</div>

CSS

.buttons input {
    margin: 5px;
    padding: 5px 5px 5px 20px; /* 20px makes room for your background image */
    border: 1px solid #aaa;
}

.buttons .apply {
    background: #eee url(path/to/apply.png) no-repeat 0 50%;
} 

.buttons .cross {
    background: #eee url(path/to/cross.png) no-repeat 0 50%;
} 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜