HTML标题以斜体显示,原因不明

时间:2016-11-02 23:41:45

标签: html title italics

我页面上的标题一直显示为斜体,但我找不到任何代码表明它应该这样做。会发生什么事?我甚至从另一个页面复制/粘贴标题代码,其中标题没有斜体,但它仍然存在。

    <head>
<title>1867 Settlement - Origins</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
    background-color: #E6E6FA;
}
.style2 {
    font-size: small;
    font-style: italic;
}
.style3 {font-size: small}
a:link {
    color: #B2243B;
}
a:visited {
    color: #B2243B;
}
-->
</style>
</head>

1 个答案:

答案 0 :(得分:0)

如果你想使用内容属性

很容易设置title属性的样式
a[title]:hover:after {
 content: attr(title);
 padding: 4px 8px;
 color: #333;
 position: absolute;
 left: 0;
 top: 100%;
 z-index: 20;
 white-space: nowrap;
 -moz-border-radius: 5px;
 -webkit-border-radius: 5px;
 border-radius: 5px;
 -moz-box-shadow: 0px 0px 4px #222;
 -webkit-box-shadow: 0px 0px 4px #222;
 box-shadow: 0px 0px 4px #222;
 background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
 background-image: -webkit-gradient(linear,left top,left    bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
 background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
 background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
 background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
 background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
  }

演示Minimal, Complete, and Verifiable code example