html - Safari 中的链接聚集在一起

标签 html css cross-browser

我正在制作一个新网站,并且正在使用 Dreamweaver。我遇到的一个问题是我的链接在 safari 中聚集在一起。这是它在 Firefox

中的样子

View in Firefox

它很好但不幸的是这是它在 Safari

中的样子

View in Safari

我正在使用 Dreamweaver 开发网站,上面页面的 CSS 看起来像这样

#header {
    background-image: url(bg02.jpg);
    height: 10em;
    color: #FFF;
    font-size: 1em;
    text-align: center;
    padding: 0em;
    margin-top: -2em;
    margin-right: 0em;
    margin-bottom: 0em;
    margin-left: 0em;
    width: auto;
}

#header h1 {
    font-size: 4em;
    letter-spacing: 0.1em;
    padding-top: 0.4em;
    padding-right: 0em;
    padding-bottom: 0em;
    padding-left: 0.8em;
    text-align: center;
    display: block;
}

#header a {
    color: #468CEA;
    text-decoration: none;
    display: compact;
    font-size: 1em;
    margin-top: -2em;
    text-align: center;
}

无论如何希望有人能帮助我。非常感谢您看到这里!

最佳答案

不要使用 display: compact(这几乎不受支持),请尝试使用 display: inline-block 然后使用填充:

#header a {
    color: #468CEA;
    text-decoration: none;
    display: inline-block;
    padding: 0 5px; /* Change this to whatever suits your needs */
    font-size: 1em;
    margin-top: -2em;
    text-align: center;
}

关于html - Safari 中的链接聚集在一起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15674393/

相关文章:

在 FF 和 IE7/8/9 上工作时,带有淡入淡出的 Javascript slider 在 chrome 上失败

python - 从使用 BeautifulSoup 解析的 HTML 中删除标签

jquery - 如何在 asp.net 转发器中选择一个 div

javascript - 将样式属性迁移到单独的 .css 文件

html - 在 css 中对齐列表项

javascript - Internet Explorer 中模块的加载超时

javascript - 从多对象中获取值

css - ReactJS 样式化组件以全屏显示背景色

javascript - deezer 播放器和 url 更改没有音乐停止

javascript - 根据浏览器版本删除所有样式