我正在尝试将CSS包含在我的JSP中,我尝试了很多来自互联网的建议,但这些建议都不适用于我。
如果有人可以提供帮助,我会感激不尽!
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="${pageContext.request.contextPath}/css/Login.css" rel="stylesheet" type="text/css"/>
<title>Login</title>
</head>
<body>
<p>test</p>
<s:form action="loginAction" method="post">
<s:textfield type="text" label="User Name:" name="username"/>
<s:password type="text" label="Password: " name="password"/>
<s:submit value="login" type="submit"/>
</s:form>
</body>
</html>
p {
font-family: verdana;
font-size: 20px;
color: red;
}
WebContent
- css/Login.css
- WEB-INF
- ... jsp -s
...