- 我尝试输入绝对路径、相对于资源文件夹的路径等,但仍然看不到。*
主文件.jsp
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Simple Title </title>
<link href = "css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<header>
<img class = "avatar" src = "images/skyrim-logo.png" alt = "avatar">
<span class = "header-info">
... some info ...
</span>
</header>
<div class="container">
<div class="container-header">
Enter point coordinates
</div>
</div>
</body>
</html>
字符串src = "images/skyrim-logo.png"
-此行包含问题
1条答案
按热度按时间ws51t4hk1#
该行:
<link href = "css/style.css" rel="stylesheet" type="text/css">
是相对于
webapp
目录的。但是<img class = "avatar" src = "images/skyrim-logo.png" alt = "avatar">
指向不属于
webapp
目录结构的目录,因此对JSP页不可见。您需要将
fonts
和images
目录都移动到webapp
目录中。