使用CSS设置电子邮件链接/ href ="mailto:"

Rol*_*and 14 css mailto email href

感谢StackOverflow,我终于找到了一种方式来设置我的电子邮件链接,但我想知道为什么没有我在这里找到的解决方案它不起作用.

由于链接是带有属性类"约"的跨度的一部分,其中定义了字体大小和样式,因此电子邮件链接不应该显示在11px和sans serif中吗?

而且

a[href^="mailto:"]

{ 
  font-family: sans-serif;
  color: black;
  font-size: 11px;
}
Run Code Online (Sandbox Code Playgroud)

一旦我尝试改变它,它就会很有效

.about a[href^="mailto:"]

{ 
  font-family: sans-serif;
  color: black;
  font-size: 11px;
}
Run Code Online (Sandbox Code Playgroud)

它也没有像它想象的那样发挥作用.

做标签不听跨度格式或类嵌套?

    <!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 .&nbsp;&nbsp;&#124;&nbsp;
            <span="address">Website Information</span> &mdash; <a href="mailto:info@info.eu">info@info.eu</a>
        </span>
</div>



</body>
</html>
Run Code Online (Sandbox Code Playgroud)

Sha*_*ora 24

嗨,实际上你已经评论了你的电子邮件链接css: -

所以现在写这个方法的css工作正常......

a[href^="mailto:"]
{ 
  font-family: sans-serif;
  color: red;
  font-size: 11px;
}
Run Code Online (Sandbox Code Playgroud)

看演示: - http://jsbin.com/ijofoq/edit#html,live

更新

现在它的工作正常...编辑你的HTML并添加你的HTML

<div class="bottom-left">
    <div class="about">
        <span class="bold">XYZ</span> is a project space .&nbsp;&nbsp;&#124;&nbsp;
        <span="address">Website Information</span> &mdash; <a href="mailto:info@info.eu">info@info.eu</a>
    </div>
Run Code Online (Sandbox Code Playgroud)

基本上你必须从中删除span标签.关于上课.

检查一下: - http://jsbin.com/ijofoq/2/edit