【发布时间】:2013-12-04 08:36:14
【问题描述】:
我正在为我的 jsf 页面设置样式,但是当我运行它时,浏览器 (Chrome) 上没有显示任何内容。
我正在使用 eclipse 开普勒、glassfish4 和 primefaces
这是html代码
<div class="box">
<p:graphicImage url="images/usericon.png" id="usericon"
alt="utilisateur IsetN"></p:graphicImage>
<br></br>
<p:inputText placeholder="Login" required="true"></p:inputText>
<br></br>
<p:password value="#{passwordController.password}"
promptLabel="#{msg['password.promptLabel']}"
weakLabel="#{msg['password.weakLabel']}"
goodLabel="#{msg['password.goodLabel']}"
strongLabel="#{msg['password.strongLabel']}" required="true"
placeholder="Mot de passe" />
<br></br>
<p:commandButton value="Connexion" />
<br></br>
<h:link url="#">Aide?</h:link><br></br>
</div>
这就是风格
.box{
height:100px;
width:100px;
/*border-radius*/
-webkit-border-radius:15px;
-moz-border-radius:15px;
border-radius:15px;
background-color:#cdcdcd;
/*box-shadow*/
-webkit-box-shadow:0 8px 6px -6px #efefef;
-moz-box-shadow:0 8px 6px -6px #efefef;
box-shadow:0 8px 6px -6px #efefef;
margin:50% 50% 50% 50%;
}
注意:没有样式的组件效果很好。
【问题讨论】:
-
“浏览器上没有显示任何内容” 这似乎与 CSS 没有任何关系。在浏览器中右键单击页面,执行查看源代码。你看到了什么?您是否看到原始 JSF 源代码或其生成的 HTML 输出?