【发布时间】:2014-07-22 06:52:04
【问题描述】:
如何在 jsf 中设置背景图片。我想将 (imag.jpg) 设置为背景。图片
放置在资源/图像/imag.jpg
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>JSF Example</title>
<style>
.Bimage{background-image:url("resources/images/imag.jpg"); }
</style>
</h:head>
<h:body styleClass="Bimage">
<h:graphicImage library="images" name="download.jpg"> </h:graphicImage>
<h3>JSF 2 Example</h3>
<h:form>
<h:inputText value="#{hello.name}"></h:inputText>
</h:form>
</h:body>
</html>
【问题讨论】:
-
感谢旅游回复..我改成这样 但没有得到
-
resource没有s。根据 -
也这样但没有得到
-
图片名称是“image1”还是“imag”?
标签: css jsf resources background-image