html - <h :commandLink> and <h:commandButton> for same style 之间的 CSS 问题

标签 html css jsf

在我的示例应用程序中,JSF 页面底部有 3 个操作按钮,它由 2 个命令按钮和一个命令链接设计。问题是我为这 3 个提供了相同的样式类,但命令按钮在单行中正确显示,但命令链接不在同一行中。

此页面中的示例 A 是作者,B,c 是作者

-----------------------------------------
|                                        |
|                                        |
|                                        |  
|                                        |
|                        ----- -----     |
|                 -----  | B | | c |     |
|                 | A |  ----- -----     |   
|                 -----                  |
-----------------------------------------

我需要在同一行中显示。这些按钮的样式类是。

.ButtonStyle{
    border: 1px solid #999;
    padding:1px 4px 1px 4px;
    color: #333;
    background-color: #e7e7e7;
    text-decoration: none;
    margin-right: 10px;
    display: inline;
    cursor:pointer;
}

这 3 个的编码是:

<div align="right'>
 <h:commandLink id="" action=".."  value="A" styleClass="ButtonStyle"/> 
 <h:commandButton id="" action=".."  value="B" styleClass="ButtonStyle"/>
 <h:commandButton id="" action=".."  value="C" styleClass="ButtonStyle"/>
</div>

我发现的问题在<h:commandlink>样式与 <h:commandbutton> 不匹配.

谁能帮我解决这个问题?

最佳答案

试试这个(我有点猜是因为我不熟悉 JSF):

.ButtonStyle {
    vertical-align: top
}

默认的 vertical-alignbaseline,它看起来像您的 ASCII 艺术。

关于html - <h :commandLink> and <h:commandButton> for same style 之间的 CSS 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7347399/

相关文章:

java - 将多个图像返回到 JSF 页面

jquery - Jquery 中的 Ajax 不适用于本地文件

html - CSS 伪类 :hover in content editor webpart does not function correctly in ie8/ie7

jquery - "Remove"图标和居中对齐 ListView 中的文本通过 css

html - 如果谷歌字体不可用,如何指定网络安全用户默认字体

css - gulp 可以创建表情符号的图标字体任务吗?

html - 垂直收缩图像

java - JSF 2 小时 :message in composite component can't find id of input

javascript - 灯箱 iframe 关闭

javascript - 我的 HTML/CSS 不允许我与我的程式化复选框进行交互