html - 奇怪的 Html Css 错误

标签 html css browser

我在asp.net平台上开发了一些html。
但是在 Firefox 和 Google chrome 浏览时我得到了不同的结果。 enter image description here

这里有两个副标题,“Vence Vacation Rentals and Vence Hotels”和“Vence Vacations: Things to see while on vacation in Vence Provence”

第一个是h2标签,第二个是h3标签。
我对 h2 和 h3 标签应用了相同的样式。 但正如您所看到的图像,颜色略有不同。
这是h2和h3的html代码和样式。

<div style="padding-bottom: 10px;margin-left:20px;">  
<h2 class='titles'>
Vence Vacation Rentals and Vence Hotels
                             <br />  
 </h2>
</div>


 <h3 class='titles'>
  Vence Vacations: Things to see while on vacation in Vence Provence
 </h3>  

对于样式

.titles {
color: #154890 !important;
font-family: Verdana;
font-size: 18px;
font-weight:500;
}

h3 的样式嵌入在 h3 标签中。 我不知道为什么两个标题的颜色不同。
h2的颜色好像比h3的颜色深一些。
请帮助我。
谢谢。 (请原谅我的英语水平低下)

最佳答案

你知道你没有为 h3 发送字体吗?此外,在 html 标签中嵌入样式也不是最佳做法。您是否有任何其他可能会干扰的样式表加载?

关于html - 奇怪的 Html Css 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40188734/

相关文章:

html - 在 CSS 中插入自定义字体

javascript - 在一个div中居中多个div

JavaScript 动态淡入淡出背景图像

javascript - 检测 WordPress 中的浏览器下载错误

javascript - 如何捕获浏览器关闭事件?

html - Bootstrap - 如何在新行中设置内容

html - 如何对齐顶部的表格单元格内容?

javascript - 在使用 Javascript 时使用 CSS 在 HTML 中设置样式

css - masonry 柱宽 %

ios - Mobile Safari 在硬重置时清除 cookie 和 LocalStorage