【发布时间】:2016-01-25 13:34:40
【问题描述】:
到目前为止,我在同一个 jsp 文件中使用 css 代码为我的 jsp 页面设置背景图像,我通过将 css 代码映射到 body 标记来做到这一点。有用。就像:
<html>
<style>
body
{
background:url(deploy/images/bg.jpg) no-repeat center center fixed;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
margin: 0;
padding: 0;
}
</style>
<body id="body">
<h1>hello</h1>
</body>
</html>
上面的 jsp 存在于 web-inf 文件夹中,我需要将 css 从外部放置在 web-inf/deploy/css 文件夹中,并在所有其他 jsp 中使用外部 css。
如何在 web-inf/deploy/css 文件夹中创建外部 css,以及如何在所有其他 jsps 中将其引用为 body 标签。谢谢。
【问题讨论】:
标签: html css jsp background-image stylesheet