感谢StackOverflow,我终于找到了一种样式化我的电子邮件链接的方法,但我想知道为什么在没有在这里找到的解决方案的情况下它不起作用。
由于该链接是具有属性类“about”的span的一部分,该类定义了字体大小和样式,所以电子邮件链接不应该显示为11px无衬线字体吗?
而同时
a[href^="mailto:"]
{
font-family: sans-serif;
color: black;
font-size: 11px;
}
很好用,只要我尝试将其改变为
.about a[href^="mailto:"]
{
font-family: sans-serif;
color: black;
font-size: 11px;
}
它的功能并不像预期的那样。
是否 <span>
标签不能遵循样式或类嵌套?
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html {
height:100%;
}
body {
height: 100%;
margin-left: 20px;
margin-top:0px;
}
.bottom-left {
position: absolute;
font:sans-serif;
bottom: 15px;
left: 15px;
}
.bold {
font-family: serif;
}
.about {
font-size: 11px;
font-family: sans-serif;
}
/*a[href^="mailto:"]
{
font-family: sans-serif;
color: black;
font-size: 11px;
}*/
.address {
font-size: 11px;
border-bottom: 1px grey dotted;
}
</style>
<title>TEMP</title>
</head>
<body>
<div class="bottom-left">
<span class="about">
<span class="bold">XYZ</span> is a project space . |
<span="address">Website Information</span> — <a href="mailto:info@info.eu">info@info.eu</a>
</span>
</div>
</body>
</html>
div
中工作,但不能在span
中工作。 - OACDesigns