好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

css中a标签下面的线怎么加粗

在css中,可以 利用 “border-bottom”属性和“text-decoration”属性让a标签下面的线 加粗 ,语法为“a{text-decoration:none;border-bottom:线的粗细值 solid 颜色值;}”。

本教程操作环境:windows10系统、CSS3 && HT ML 5版、Dell G3 电 脑。

css中a标签下面的线怎么加粗

在css中,可以利用border-bottom属性和text-decoration属性来让a标签下面的线加粗,

text-decoration属性用于规定添加到文本的修饰,border-bottom属性用于设置元素的下边框样式,因此,我们可以先把a标签原本的下划线去除掉,使用a 标签元素 的下边框来作为a标签下面的线,这样只需要设置a标签下边框的粗细值就可以了。

示例如下:

<!DOCTY PE  html>
<html lang="en">
<head>
    < ;m eta charset="UTF-8">
    <meta n am e="viewport" content="width=device-width, in IT ial -s cale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie= Edge ">
    <title>Document</title>
    <style>
        a{
            color: red ; 
            border-bottom:5px solid red; 
            text-decoration:none; }
    </style>
</head>
<body>
    <a  hr ef="">这是一个a标签</a>
</body>
</html>

输出结果:

(学习视频分享:css视频教程)

以上就是css中a标签下面的线怎么加粗的详细内容,更多请关注其它相关 文章 !

总结

以上是 为你收集整理的 css中a标签下面的线怎么加粗 全部内容,希望文章能够帮你解决 css中a标签下面的线怎么加粗 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于css中a标签下面的线怎么加粗的详细内容...

  阅读:22次