好得很程序员自学网

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

css实现文字居中两边横线效果的示例代码

本文介绍了css实现 文字居中 两边横线效果的示例代码,分享给大家,具体笔记如下:

效果:

<!docty PE  ht ML >
<html lang="en">
<head>
    < ;m eta charset="UTF-8">
    <meta n am e="viewport"
          content="width=device-width, user -s calable=no, in IT ial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie= Edge ">
    <title>Document</title>
    <style>
        .title{
            text-align:  center ;
            position: relative;
            h ei ght: 50px;
            line-height: 50px;
            width: 800px;
            m arg in: 200px auto;
        }
        .title :after ,.title:before{
            content: "";
            position: absolute;
            top: 50%;
            background:  # 7a7a7a;
            height: 1px;
            width: 35%;
        }
        .title:after{
            left: 0;
        }
        .title:before{
            right: 0;
        }
    </style>
</head>
<body>
    <div class="title">css实现文字居中两边横线效果</div>
</body>
</html>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

总结

以上是 为你收集整理的 css实现文字居中两边横线效果的示例代码 全部内容,希望文章能够帮你解决 css实现文字居中两边横线效果的示例代码 所遇到的问题。

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

查看更多关于css实现文字居中两边横线效果的示例代码的详细内容...

  阅读:23次