Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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 Google字体和Safari选择问题_Html_Css_Webkit_Safari - Fatal编程技术网

Html Google字体和Safari选择问题

Html Google字体和Safari选择问题,html,css,webkit,safari,Html,Css,Webkit,Safari,当我从谷歌字体导入字体时,我在选择上有问题。当我点击Safari上的select时,网站会重新加载。在铬上,FF(一切正常)。例如: 有人能帮忙吗?我不确定JQuery是否是您想要走的路线,但这可能会有所帮助: <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script> </head> <body>

当我从谷歌字体导入字体时,我在选择上有问题。当我点击Safari上的select时,网站会重新加载。在铬上,FF(一切正常)。例如:


有人能帮忙吗?

我不确定JQuery是否是您想要走的路线,但这可能会有所帮助:

<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
</head>
<body>
    <select id="dropdown">
        <option>kiko</option>
        <option>atletico</option>
    </select>

    <script>
    jQuery(document).ready(function($){
        $("#dropdown").click(function(event) {
        event.preventDefault();
        });
    });
    </script>

这似乎是Safari 5.1中的一个bug。使用CSS@font-face进行的每一次选择都会在重新加载页面时失败。

您可以通过CSS将Safari作为目标,避免出现以下问题:

@media screen and (-webkit-min-device-pixel-ratio:0) {

/* for Safari 5.1 bug http://stackoverflow.com/questions/7025826/google-fonts-safari-select-problem */

.formData SELECT {

    font-family:Helvetica, arial, sans-serif;
}

}

最好使用或应用必要的css和javascript,而不是在这种特殊情况下使用,因为我们必须应用不同的字体系列、字体样式等。

您使用的safari版本是什么?什么操作系统?在Safari 5.0.5和Win 7Safari 5.1 6534.50上运行良好的矿井;MAC OS X 10.6.8在我的经历中也发生了同样的事情