Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 除了Internet Explorer和Firefox之外,该网站在大多数浏览器中都很不错_Html_Css_Navigation_Compatibility - Fatal编程技术网

Html 除了Internet Explorer和Firefox之外,该网站在大多数浏览器中都很不错

Html 除了Internet Explorer和Firefox之外,该网站在大多数浏览器中都很不错,html,css,navigation,compatibility,Html,Css,Navigation,Compatibility,我目前正在建立一个基本的网站,我可以作为一个投资组合时,试图进入大学使用 目前,除了IE和Mozilla Firefox之外,我的网站在所有主要浏览器中都能正常工作 我真的不知道如何解决这个问题,因为我才真正开始学习编程 我的第一个主要问题是让所有浏览器的导航都相同。下图显示了我希望导航的外观: 但在Internet Explorer上显示的是。。。 (CSS基本上都不适用于此吗?) 在Mozilla Firefox上,它显示了以下内容: (为什么间距如此之远?而且距离包装开始的位置也非常远)

我目前正在建立一个基本的网站,我可以作为一个投资组合时,试图进入大学使用

目前,除了IE和Mozilla Firefox之外,我的网站在所有主要浏览器中都能正常工作

我真的不知道如何解决这个问题,因为我才真正开始学习编程

我的第一个主要问题是让所有浏览器的导航都相同。下图显示了我希望导航的外观:

但在Internet Explorer上显示的是。。。 (CSS基本上都不适用于此吗?)

在Mozilla Firefox上,它显示了以下内容: (为什么间距如此之远?而且距离包装开始的位置也非常远)

代码:

HTML:

如果需要更多的代码,我可能需要提供,那么我会这样做

谢谢大家!

有几件事

1) 你需要重新设置你的css

* { margin: 0; padding: 0; outline: 0; }
2) 对于IE图片,我想是IE7还是IE8?因为我感觉“导航”元素不被识别。(nav是html5元素,IE7/IE8无法识别)


3) 除了firefox和IE以外的所有浏览器?Chrome、opera、safari还剩下什么(从现在起,opera都有opera next并放弃了presto)?如果你是在Safari一年前放弃win支持后在windows上测试的,你可以说只有opera和chrome…所以在那里使用的主浏览器有50%的支持…

我已经注意到两个问题。首先,将
nav ul li
设置为
display:inlineblock而不是
显示:内联块。这使得该元素无效。此外,您没有执行CSS重置。尝试使用此代码创建一个
reset.css
文件,并在HTML中链接到该文件:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
另外,InternetExplorer8因缺乏对特定HTML和CSS规范的支持而臭名昭著,因此您需要为其提供单独的样式表。要检测IE8,请使用类似于以下代码的代码:

<!--[if IE 8]>
    <link href="css/ie8.css" type="text/css" rel="stylesheet" />
<![endif]-->


祝你好运

这是我看到的一个问题,
nav ul li{display:inlineblock;
。它应该是
inline block
。我猜您输入了一个错误。注意:我还没有测试,这可能无法解决您的问题。只是它引起了我的注意。这里。这将帮助您)
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
<!--[if IE 8]>
    <link href="css/ie8.css" type="text/css" rel="stylesheet" />
<![endif]-->