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 使用@font-face时firefox和IE中的负上边距_Html_Css_Internet Explorer_Google Chrome_Firefox - Fatal编程技术网

Html 使用@font-face时firefox和IE中的负上边距

Html 使用@font-face时firefox和IE中的负上边距,html,css,internet-explorer,google-chrome,firefox,Html,Css,Internet Explorer,Google Chrome,Firefox,我一直在用谷歌Chrome开发一个网站,最后决定看看它在IE和Firefox中的样子。令我惊讶的是,与chrome相比,Firefox和InternetExplorer都有同样的问题。当使用@font-face导入字体时,Google Chrome会以我希望的方式显示内容,但Firefox和Internet Explorer都会以假想的“负上边距”显示字体。我附上了一些截图,因为这有点难以解释 谷歌浏览器 火狐 Internet Explorer 谷歌浏览器 火狐 Internet E

我一直在用谷歌Chrome开发一个网站,最后决定看看它在IE和Firefox中的样子。令我惊讶的是,与chrome相比,Firefox和InternetExplorer都有同样的问题。当使用@font-face导入字体时,Google Chrome会以我希望的方式显示内容,但Firefox和Internet Explorer都会以假想的“负上边距”显示字体。我附上了一些截图,因为这有点难以解释

谷歌浏览器

火狐

Internet Explorer

谷歌浏览器

火狐

Internet Explorer

有人知道这是什么原因吗?我尚未实施浏览器修复,因此导航栏的所有CSS都是:

<div id="nav">
    <ul>
        <li>
            <a href="#main">HOME</a>
        </li>
        <li>
            <a href="#news">NEWS</a>
        </li>
        <li>
            <a href="#events">EVENTS</a>
        </li>
        <li>
            <a href="#about">ABOUT</a>
        </li>
        <li>
            <a href="#music">MUSIC</a>
        </li>
        <li>
            <a href="#study">STUDY</a>
        </li>
        <li>
            <a href="#gallery">GALLERY</a>
        </li>
        <li>
            <a href="#shop">SHOP</a>
        </li>
        <li>
            <a href="#contact">CONTACT</a>
        </li>
    </ul>
</div>
事件列表的标记为:

<div class="entry">
    <div class="date">
        <div class="day">15</div>
        <div class="month">Nov</div>
    </div>      
    <div class="location">
        <div class="city">Melbourne</div>
        <div class="club">St Judes Anglican Church</div>
    </div>  
    <div class="clear"></div>
</div>

有人知道关于这个问题的任何信息吗?

这里是“#nav a”而不是“height”,尝试删除height并使用padding:20px 25px

我已经提到了根据字体大小填充的示例,您可以添加使用填充….

如果所有其他方法都失败,您可以引入行高?

正如Boris Zbarsky在评论中建议的那样,字体的度量标准存在问题。我从一个专门的@font-face网站下载了一份新的打字工具包,现在就可以使用了

标记在哪里……您只在css中添加了标记。@AdityaSaxena我添加了标记。列表项没有样式。字体的度量可能有错误,IE/Firefox使用的度量是错误的,但Google没有使用它,因为它依赖于字体度量的其他部分。。。你有没有在一个像样的字体编辑器中查看过字体的指标?@BorisZbarsky Nup,但由于它不仅仅是一个单一的字体,我怀疑它的真实性。我查一下。好的。好吧,如果没有看到实际的标记,很难说出其他任何东西。根据上面的样式,主页和新闻应该垂直堆叠,但它们在屏幕截图中彼此相邻,因此这里显然有更多相关的样式。除了使按钮高度非常大之外,什么都不做。它们都有线条高度,可以垂直对齐它们的中心。
<div class="entry">
    <div class="date">
        <div class="day">15</div>
        <div class="month">Nov</div>
    </div>      
    <div class="location">
        <div class="city">Melbourne</div>
        <div class="club">St Judes Anglican Church</div>
    </div>  
    <div class="clear"></div>
</div>
#events .entry{
    text-transform: uppercase;
    font-family: bebas;
    font-size: 30px;
    color: #555555;
    word-spacing: 4px;
    border-top: 2px solid #4A3948;
}
.city{
    font-size: 40px;
}

.location{
    padding-left:10px;
}
.day{
    font-size: 65px;
    line-height: 55px;
}
.date{
    text-align: center;
    width: 95px;
    border-right: 4px solid;
}
.club{
    font-size: 28px;
    line-height: 31px;
}