0

我正在编写一个脚本,它使用一堆情境变量将 .HTML 文件放在一起。代码看起来很好,显示也很好,除了一个问题 - 我试图包含的 CSS 和 HTML 文件没有显示出来,当我查看源代码时,包含语句就在那里,但是,它们不会出现在实际页面上。

这是我的代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
      <link rel="shortcut icon" href="/newsbasearchive/Images/favicon.ico" />
      <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />

      <title>NewsBase - News, analysis and business intelligence from emerging markets</title>

      <style type="text/css">
      @import url("/newsbasearchive/CSS/newsbase.css");
      </style>

      <!--#include virtual="/newsbasearchive/includes/google.html" -->


    </head>
    <body>
       <table width="1148" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

    <!--#include virtual="/newsbasearchive/includes/header.html" -->
        <!--#include virtual="/newsbasearchive/includes/nav.html" -->

我上传到的网站已经使用了包含这些文件的页面,并且它们工作正常 - 唯一的区别是这些页面是 .JSP (并以 .jsp 方式包含页面,我认为是 '<@' -它们都来自 /newsbasearchive/ (网站的根目录),但是我从我给他们的路径中引用根目录,所以我不明白为什么它不起作用。

谁能告诉我怎么了?

提前致谢!

4

1 回答 1

0

您不能css使用与 .html 中相同的方式在 html 中包含文件jsp。要在 html 中包含样式表,请在以下head部分中使用此格式:

<LINK href="special.css" rel="stylesheet" type="text/css">

您可以在此处阅读有关它的更多信息:HTML 中的样式表

于 2013-01-25T11:11:46.740 回答