【问题标题】:Site working in Safari but not Firefox or Chrome网站在 Safari 中运行,但不是 Firefox 或 Chrome
【发布时间】:2014-11-18 22:19:53
【问题描述】:

我做了一个网站,一切都很顺利,直到我尝试用 chrome 打开它,然后用 firefox 打开它。什么都没有。。

如果有人能帮助我了解为什么它只适用于 Safari,我将不胜感激?

谢谢。

下面是我的代码-

    <!doctype html>
<html>
<head>
<style type="text/css">
a:hover {
cursor:default;
}
</style>
<style type="text/css">
a { text-decoration:none }
</style>
<meta charset="UTF-8">
<style type="text/css">
body {
margin: 0;
font-size: 20px;
font-family: Avenir;
font-style: normal;
font-size:26px;
font-weight: 500;
}


section {
display: block;
height: auto;
width: auto;
min-width: auto;
min-height: 700px;
padding: 151px;
}
#RIP{
background: #000000;
color: #FFFFFF;
font-family: Avenir;
color: #ffffff;
font-size: 26px;
font-weight: 500;
transform: scale(7.193,7.193);
}
#Concept{
background:#FFFFFF;
color:#000000;
}
#Clients{
background:#000000;
color:#FFFFFF;
}
#Contact{
background:#FFFFFF;
color:#000000;
}
nav {
font-style: normal;
font-size:12px
color: #FFFFFF;
background color:#FFFFFF
text-decoration: none;
position: fixed;
text-align: center;
list-style-position: centre;
padding: 18px;
text-align:center
}
.nav {
position: fixed;
color: #FFFFFF;
background-color: #000000;
list-style-position: centre;
nav-index: centre;
text-decoration: none;
text-align: centre;
}
</style>

<script src="javascripts/jquery-1.11.1.min.js"></script>

<script src="javascripts/smoothscroll.js"></script>

<style type="text/css"> 
a:link { 
COLOR: #FFFFFF; 
} 
a:visited { 
COLOR: #FFFFFF; 
} 
a:hover { 
COLOR: #000000; 
} 
a:active { 
COLOR: #000000; 
} 
</style>
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
<style type="text/css">
body {
margin: 0;
font-size: 20px;
font-family: Avenir;
font-style: normal;
font-size:26px;
font-weight: 500;
}


section {
display: block;
height: auto;
width: auto;
min-width: auto;
min-height: 700px;
padding: 151px;
}
#RIP{
background: #000000;
color: #FFFFFF;
font-family: Avenir;
color: #ffffff;
font-size: 26px;
font-weight: 500;
transform: scale(7.193,7.193);
}
#Concept{
background:#FFFFFF;
color:#000000;
}
#Clients{
background:#000000;
color:#FFFFFF;
}
#Contact{
background:#FFFFFF;
color:#000000;
}
nav {
font-style: normal;
font-size:12px
color: #FFFFFF;
background color:#FFFFFF
text-decoration: none;
position: fixed;
text-align: center;
list-style-position: centre;
padding: 18px;
text-align:center
}
.nav {
position: fixed;
color: #FFFFFF;
background-color: #000000;
list-style-position: centre;
nav-index: centre;
text-decoration: none;
text-align: centre;
}
</style>

<script src="javascripts/jquery-1.11.1.min.js"></script>

<script src="javascripts/smoothscroll.js"></script>

<style type="text/css"> 
a:link { 
COLOR: #FFFFFF; 
} 
a:visited { 
COLOR: #FFFFFF; 
} 
a:hover { 
COLOR: #000000; 
} 
a:active { 
COLOR: #000000; 
} 
</style>
<script type="text/javascript">

</script>
</head>
<nav></nav>
<nav class="nav"><a href="#RIP">RIP</a> <a href="#Scope">Scope</a> <a href="#Clients">Clients</a> <a href="#Contact">Contact</a></nav>

<section id="RIP"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('logo','','/images/blank.png',1)"><img src="/images/RIP.png" alt="" width="492" height="106" id="logo"></a><br>
<p> RestInProjects is a strategic consultancy and collaborative studio based<br>
in London and Berlin.</p>
<p>
We focus on but are not limited to; advising, public relations, web, media<br> 
and design in the fashion industy.
</section>
<section id="Scope">Scope<p>
Social Media Management, Strategic consultancy, Sourcing, Production,<br>
Content creation, E-commerce, Networking, Web Design, App Design,<br> 
Casting, Design, Press, PR
</section>
<section id="Clients">Clients<p>
Adidas, American Express, Barbour, Bread & Butter Asia, Capsule,<br> 
Coffin on Cake, Drapers, Fred Perry, GQ, Harvey Nichols, i-D<br> 
Jacket Required, Lacoste, Malmo London, Mini, Mo Studior, Niice<br> 
London, SEEK, U-homme, Umbro, Van Liebling, WeShallRun<br> 
</section>
<section id="Contact">Contact<p>
Portfolio On Request<br>
info@restinprojects.com
</section>
<p>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<span style="text-align: right">RIP.</span>
</body>

</html>

【问题讨论】:

    标签: jquery html google-chrome safari


    【解决方案1】:

    查看 Ameer Elsherif 的回答,指出您的一些问题。另一个问题是这样的:

    在两个&lt;style&gt;-tags 中为#RIP 设置样式。

    删除transform: scale(7.193,7.193);这两个行,然后页面在所有浏览器中看起来都一样。

    使用 scale(7.193,7.193) 可以放大页面的大小。只有 Safari 不理解转换并以正常大小显示。

    【讨论】:

    • 感谢您的回答。我已经修复了错误并使用 w3 验证器进行了检查,但在 chrome 中仍然没有运气?该网站是restinprojects.com
    • @ElliottWalker 我已经快速浏览了该站点。您仍然在 &lt;style&gt;-tags 中包含了两次相同的 CSS,其中一个中仍然有一个 #RIP {transform: scale(7.139,7.139);}。去掉加倍的CSS和transform就可以了。
    • 实际上是 {transform: scale(7.139,7.139);}。非常感谢您的帮助,我真的很感激。
    【解决方案2】:

    你的 CSS 代码中有很多拼写错误的单词,比如你写的是“centre”而不是“center”。

    此外,您在第 55 行和第 57 行中缺少分号。

    我建议您在 Aptana Studio 或 Netbeans 等 IDE 中打开您的代码,它会自动为您标记错误。

    编辑:刚刚注意到您还缺少开始的正文标记。

    【讨论】:

      【解决方案3】:

      您缺少&lt;BODY&gt; 标签。

      通过 W3C 语法验证器运行您的网站以查找更多问题。 http://validator.w3.org/

      【讨论】:

        猜你喜欢
        • 2016-10-23
        • 1970-01-01
        • 1970-01-01
        • 2014-05-21
        • 1970-01-01
        • 2017-11-13
        • 2013-02-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多