0
how to correctly link my style sheets in my JSP Servlet project? Below is the structure of my project. Also I do not know if the correct hierarchy. Help me. I already tried .. /webapp/style/style.css and nothing. I tried to modify and put the stylesheet in the webapp folder and link:
<link rel="stylesheet" type="text/css" href="estilo.css" >
But you can’t, and like on the page it’s just an edge, it doesn’t pull everything...
Page HOME.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="javax.servlet.http.HttpSession" %>
<%@ page import="br.edu.unilasalle.model.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link href="style/estilo.css" rel="stylesheet"/>
</head>
<body class="fundo">
<h1>Menu Principal</h1>
<h3>Opções</h3>
<a href='CadastroUsuario.jsp'>Cadastro de Usuário</a><br>
<a href='CadastroBancos.jsp'>Cadastro de Bancos</a><br>
<a href='CadastroCategorias.jsp'>Cadastro de Categorias</a>
<%
if(request.getSession(true).getAttribute("usuario")!=null){
Usuario usuario=
(Usuario)request.getSession(true).getAttribute("usuario");
%>
<p>
Usuário: <%=usuario.getId()%>. <%=usuario.getNomeCompleto() %> <a
href="LogoutController">Sair</a>
</p>
<%} %>
</body>
</html>
Style page.css
@CHARSET "ISO-8859-1";
body{
background: rgba(0,77,153,0.6);
border: 4px solid #8080c0;
margin: 200px 500px 0px 500px;
border-radius: 125px;
}
div {
color: white;
font-family: 'Times New Roman';
font-size: 20px;
padding: 80px;
padding-bottom: 60px;
}
#acesso{
margin-bottom: 5px;
margin-left: 150px;
font-family: 'Times New Roman';
color: blue;
}
.fundo{
background: url('../WebContent/img/wallpaper.jpg') no-repeat center;
margin:0;
padding:0;
background-size:cover;
}
It doesn’t work. Open the page and the only property of the stylesheet that works is Border: 4px; On the sheet have some properties and inspecting the code, they are scratched... Why?
– Rafael Blum
I removed all comments
– Rafael Blum
Bah... worse than it worked! How careless of me and I didn’t even realize!
– Rafael Blum
Very well ! Next time you know!! Thanks!!!
– Pena Pintada