【问题标题】:Change in HEAD makes site not work correctly?更改 HEAD 会使网站无法正常工作?
【发布时间】:2012-05-11 02:16:58
【问题描述】:

我在文档的头部添加了新的元标记和不同的标题标记,这使得重绘黑色背景的 IE 代码不起作用。

知道我错过了什么吗?我在新代码中看不到任何会导致它中断的内容?

旧的正确工作代码:

 <!-- saved from url=(0022)http://internet.e-mail -->
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>netball</title>
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.4.1/build/cssreset/cssreset-min.css">
    <link href="style.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="favicon.ico"> <!--[if IE 6]>
    <link href="ie6.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <!--[if IE 7]>
    <link href="ie7.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <!--[if IE 8]>
    <link href="ie8.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <!--[if IE 9]>
    <link href="ie9.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <!--[if IE]>
    <style type="text/css">
    .black_overlay {position:absolute; top: expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px" : body.scrollTop+"px");}</style><![endif]-->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
    <script src="jquery.simpletip-1.3.1.min.js"></script>
    </head>

没有有效的新代码:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Netball - notice board</title>
<meta name="description" content="netball description to go here." />
<meta name="keywords" content="net, ball, netball, womens" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.4.1/build/cssreset/cssreset-min.css">
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="favicon.ico"> <!--[if IE 6]>
<link href="ie6.css" rel="stylesheet" type="text/css">
<![endif]-->
<!--[if IE 7]>
<link href="ie7.css" rel="stylesheet" type="text/css">
<![endif]-->
<!--[if IE 8]>
<link href="ie8.css" rel="stylesheet" type="text/css">
<![endif]-->
<!--[if IE 9]>
<link href="ie9.css" rel="stylesheet" type="text/css">
<![endif]-->
<!--[if IE]>
<style type="text/css">
.black_overlay {position:absolute; top: expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px" : body.scrollTop+"px");}</style><![endif]-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js">
</script>
<script src="jquery.simpletip-1.3.1.min.js"></script>
</head>

【问题讨论】:

  • 如果您删除更改的标题和元标记会怎样?
  • 您的链接标签未关闭,请先尝试关闭并重试。

标签: html css


【解决方案1】:

您的链接标签看起来格式不正确。关闭它们,你应该会很好。

【讨论】:

  • 嗨 Stefan,我认为这行得通,但事实并非如此。我关闭了两个标签: yui.yahooapis.com/3.4.1/build/cssreset/cssreset-min.css" /> 就是这样那需要做吗?
  • IF IE 块中的那些
  • 谢谢 Stefan,我现在也做了这些。是否也与第一个示例中所有 HTML 上方的注释有关?这是将 IE 推入怪癖模式还是什么?
  • 是的,doctype 之前的 cmets 一定会给你带来问题。因为它,我发现了一些关于错误行为的参考:stackoverflow.com/questions/941100/…
猜你喜欢
  • 1970-01-01
  • 2015-10-20
  • 2018-02-17
  • 2022-08-18
  • 1970-01-01
  • 2020-06-10
  • 1970-01-01
  • 2016-03-15
  • 2016-09-14
相关资源
最近更新 更多