css included in JSP is not working across browser

时间:2015-06-25 18:16:24

标签: java css jsp

I have an issue where my CSS is not getting picked up in chrome and firefox but works well in IE8. I didn't check in higher versions of IE though. below is the code where you can see Soo.css is included in the top and I'm trying to access the CSS for class="TableHeader" in the 2nd td in the table. I can see the hyperlink for 'Home' in IE8 but not in chrome and firefox. But if I remove the clas="tableheader", I can see the hyperlink for "Home" in both the browser. I don't see why it shouldn't work across browser. What is the right way to include. I have so many pages where it just works fine. below is the code snippet:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/abc.tld" prefix="abc" %>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>

<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="IBM WebSphere Studio">

<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/theme/Soo.css"/>

<%
Locale locales = Locale.US;
SimpleDateFormat SFormatDate;
DateFormat CurrentYear;
CurrentYear = DateFormat.getDateInstance(DateFormat.LONG, locales);
Date today = new Date();
SFormatDate = new SimpleDateFormat("MM/dd/yyyy", locales);
CurrentYear = new SimpleDateFormat("yyyy ", locales);
String flag = "N";
%>

<center>
<table width="100%" border="1" cellpadding="0" cellspacing="0" summary="Table used for formatting.">
    <tbody>
    <tr>
        <td colspan="3">
            <a href="http://www.abc" target="_blank" title="www.abc">
                <img src="<%=request.getContextPath()%>/images/p1_abc_logo.gif" width="157" height="25" border="0" alt="Click here to go to www.abc.">
            </a>
        </td>
        <td align="right" colspan="1">
            <img alt="Skip Repetitive Navigation Links" border="0" src="<%=request.getContextPath()%>/images/test_blank.gif"> 
            <span style="color: gray">|</span> 
            <a href="<%=request.getContextPath()%>/../../../pol1/i2_chgrequest.cfm"
               style="color: black" 
               target="system_feedback" 
               title="Feedback">Feedback</a>
            <span style="color: gray">|</span> 
            <a href="<%=request.getContextPath()%>/../../../pol1/profile/index.cfm?fa=profile"
               title="Click for Personal Profile" 
               style="color: black">Personal Profile</a>
            <span style="color: gray">|</span>
            <a href="<%=request.getContextPath()%>/../../../pol1/logout.cfm" 
               style="color: black" 
               title="Logout">Logout</a>
            <span style="color: gray">|</span> <a name="skipnav1"></a>
        </td>
    </tr>
    <!-- Side Bar -->
    <tr valign="top">
    <td nowrap width="12%" class="TableHeader" colspan="1">
    <img alt="Skip Repetitive Navigation Links" border="0" src="<%=request.getContextPath()%>/images/test_blank.gif"> <br>
        <br>
        <p style="margin-left: 1em; margin-right: 1em">
            <!-- remove href before code freeze -->
            <!--a href="<%=request.getContextPath()%>/test.jsp" style="text-decoration: none; color: white"> Back to Main Menu </a-->
            <a href="<%=request.getContextPath()%>/../../../pol1/viewer001/i3_menu.cfm?fa=account_menu&group=BMEU&toplevelpage=true" 
               title="Message Center" 
               style="text-decoration: none; color: white">Home</a>
        </p>
    </td>
    </tr>
</tbody>    
</table>

0 个答案:

没有答案