开发者

JSF commandbutton - styling

开发者 https://www.devze.com 2023-01-08 06:11 出处:网络
Is it possible to style JSF commandbutton tags to look like th开发者_开发技巧e following example:

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

精彩评论

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

关注公众号