html - H1 CSS 重置失败?

标签 html css

我很想弄清楚为什么标题链接(左侧)和导航栏中的其他链接(右侧)的高度不同。

Safari 中的差异很细微,但 IE6 中的差异更大。

我在 H1 的 CSS 重置中遗漏了一些东西?

狩猎
alt text http://img218.imageshack.us/img218/702/safari.png

IE6
alt text http://img64.imageshack.us/img64/870/ie6.png

HTML

<div id="navbar">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td align="left">
            <h1><a href="http://ide.as">title</a></h1>

        </td>
        <td align="right">
            <a href="about.html" class="color1">about</a>
            <a href="faq.html" class="color2">answers</a>
            <a href="contact.html" class="color3">contact</a>
            <input type="text" name="search" value="" id="searchbox">&nbsp;<a class="color4" href="sss">search</a>
        </td>
    </tr>
    </table>
    </div>

和CSS

#navbar a, h1 a { padding: 3px 5px; vertical-align: middle;}

h1 已重置

h1 {margin:0;padding:0;}
h1 {font-size:100%;font-weight:normal;}

最佳答案

h1 a { padding: 3px 5px; vertical-align: middle;}

为 h1 中的链接设置样式,而不是 h1 本身。

h1 {margin:0;padding:0;}
h1 {font-size:100%;font-weight:normal;}

设置 h1 的样式。因此链接的样式仍然有效,它们没有被覆盖。

关于html - H1 CSS 重置失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2002254/

相关文章:

css - 水平对齐 HTML 标题元素

javascript - 以秒和毫秒为单位的秒表

php - FPDF - 在多单元格中写入 HTML?

html - 图像作为绘制形状的 'background'

html - 全高 - Web 响应 - Twitter Bootstrap

javascript - 如何在x轴上只显示工作日?

jquery - 不同 Div 悬停时的 CSS3 动画触发器 (JQuery)

javascript - 使用标签时未在 IE 中提交表单

javascript - jquery 对话框小部件不适用于行表中的 onclick 按钮

html - 带有用户定义图标的列表菜单 (UL/LI) 上的 CSS 问题