Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 第'行前后的css;垂直对齐_Html_Css - Fatal编程技术网

Html 第'行前后的css;垂直对齐

Html 第'行前后的css;垂直对齐,html,css,Html,Css,我试图垂直对齐两行和一个标题。但它不能正常工作。我的html代码是- <div class="content-fluid"> <div class="row d-flex justify-content-center m-0"> <div class="our-service-head"> <p class="our-service-ti

我试图垂直对齐两行和一个标题。但它不能正常工作。我的html代码是-

<div class="content-fluid">
    <div class="row d-flex justify-content-center m-0">
        <div class="our-service-head">
            <p class="our-service-title text-center">Our Services</p>
        </div>
    </div>
</div>
它显示如下输出:


如何正确对齐?

使用
垂直对齐:中间

。我们的服务名称{
颜色:#22222;
字体大小:24px;
字号:600;
}
.我们的服务名称:之前,.我们的服务名称:之后{
内容:“;
显示:内联块;
垂直对齐:中间对齐;
左边距:10px;
右边距:10px;
宽度:30px;
高度:3倍;
背景色:#FFC000;
}

我们的服务

.our-service-title{
    color: #222222;
    font-size: 24px;
    font-weight: 600;
}

.our-service-title:before, .our-service-title:after{
    content:" ";
    display: inline-block;
    vertical-align: super;
    margin-left: 10px;
    margin-right: 10px;
    width: 30px;
    height: 3px;
    background-color: #FFC000;
}