Home > Web Front-end > HTML Tutorial > How to set image as background in jsp

How to set image as background in jsp

anonymity
Release: 2019-05-29 15:40:35
Original
13780 people have browsed it

How to set a picture as the background in jsp? There are two solutions.

How to set image as background in jsp

First place the image in the img folder. img is placed in the WebRoot of MyEclipse, otherwise the path may be incorrect.

(1):

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body background="img/1.jpg">
</body>
</html>
Copy after login

(2):

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.b{background-image:url(img/1.jpg)}
</style>
</head>
<body Class="b">
</body>
</html>
Copy after login

You can also write the css separately, and you can use the link to call the name of the css no matter what page is used. That's it.

The above is the detailed content of How to set image as background in jsp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
jsp
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template