【问题标题】:Require assistance with problems in my stylesheet and other issues需要帮助解决我的样式表中的问题和其他问题
【发布时间】:2014-08-04 16:22:49
【问题描述】:

我的索引页面有一个我不明白的错误,我的一个页面也从 10 个错误变为 41 个,我不知道为什么。这是 8 月 11 日的截止日期,我真的必须通过,有人可以帮忙吗?

这是我用于索引页的代码。它出现了这个错误:省略了“样式”的结束标签,但指定了 OMITTAG NO,即使头标签显然在正确的位置。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="COUNTRIES.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tunisia </title>
<style type = "text/css">
  #Tunisia {
    position:absolute;
    top:190px;
    left:53%;
</style>
</head>
<body>

<h1 class="large">Tunisia</h1>

<div id="nav1">
    <a href="Sightseeing.html">Things to See</a><br/><br/><br/>
    <a href="FamousPeople.html">Famous People</a><br/><br/><br/>
</div>

<br/>
<br/>
<p>Tunisia is the northernmost country in Africa and, at almost 165,000 square kilometres
 (64,000 sq mi) in area, the smallest country in the Maghreb region of North Africa.
 It is bordered by Algeria to the west, Libya to the southeast and the Mediterranean Sea
 to the north and east. As of 2013, its population is estimated at just under 10.8 million.
</p>

<br/><br/>
<p>To find out more information about the beautiful country of Tunisia Visit:<br/>
<a href= "http://www.cometotunisia.co.uk/">ComeToTunisia.com</a><br/></p>

<div id="tunisia">
<img src = "butterfly.jpg" alt="Albums"/>
</div>

</body>
</html>

【问题讨论】:

  • 请输入问题的具体细节。 CSS 和 JS 错误显示在浏览器控制台中。服务器日志也可能直接导致问题的根本原因,而不是要求人们执行一些随机代码并自己找出它。你可能想提供这些。不清楚你在这里问什么。请阅读常见问题解答,了解如何提出正确的问题。

标签: javascript html css


【解决方案1】:
<style type = "text/css">
  #Tunisia {
    position:absolute;
    top:190px;
    left:53%;
</style>

您忘记关闭开口{。给你:

<style type = "text/css">
  #Tunisia {
    position:absolute;
    top:190px;
    left:53%;
  }
</style>

作为警告,请注意在您的元素 ID 中使用大写字母,如本答案所述:https://stackoverflow.com/a/79022/648350。最值得注意的是这条评论

"请注意,在 XHTML 中 class 和 id 属性是区分大小写的,所有 其他属性不是。”

【讨论】:

  • 非常感谢,对使用 html 进行网页设计非常陌生,我似乎忘记了很多细节。我也不太擅长就此提出问题,但无论如何感谢它现在已得到验证。但是,我的样式表似乎只链接到我的一个页面,您对为什么会这样有任何想法吗?
  • 如果此答案对您有帮助,请不要忘记将其标记为正确答案。您需要确保在所有后续页面上再次将指向您的countries.css 文件的链接包含在head 中。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-08-06
  • 1970-01-01
  • 2021-11-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-06
相关资源
最近更新 更多