1

I am trying to add some css in my page but my css is not working.

This is my Welcome file

<%@ 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>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" href="../CSS/welcome-css.css" />
</head>
<body>

<table id="wel-table">
<tr>
<td><a href="<s:url action="/header/headerHome" />">Log In</a>  </td>
</tr>
</table>

</body>
</html>

this is my directory

Aleksandr M
  • 24,264
  • 12
  • 69
  • 143

2 Answers2

0

CAn you try it?

 <%@ 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>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    <link rel="stylesheet" type="text/css" href="../CSS/welcome-css.css" /> 
    </head>
    <body>

    <table id="wel-table">
    <tr>
    <td><a href="<s:url action="/header/headerHome" />">Log In</a>  </td>
    </tr>
    </table>

    </body>
    </html>
Thanh Duy Ngo
  • 1,521
  • 6
  • 17
  • 25
0

The link tag where you include your CSS has an XML closing slash. But your doctype declaration says HTML 4. Either switch your doctype to XHTML, or leave the link tag open as in

<link rel="stylesheet" type="text/css" href="stylez.css">

Also, you might want to get rid of the empty link tag immediately following it.

Help from W3Schools

Greg
  • 906
  • 1
  • 9
  • 22