线条和文字之间有更多空间

时间:2018-07-01 16:10:54

标签: html css

我正在尝试做这样的事情:

      ---------------------        WORK         ------------------
                           ---------------------

在这里输入我的密码

h2 { 
    width:100%;
    text-align:center;
    border-bottom: 1px solid #000;
    line-height:0.1em;
    margin:10px 0 20px; 
} 
h2 span { 
    background:#fff; 
    padding:0 10px;
}
<h2><span>THIS IS A TEST</span></h2>

我做了很多修改,但是没办法。请让我知道该怎么做?

3 个答案:

答案 0 :(得分:1)

也许,您正在寻找的是虚线虚线:Cloning into 'test'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

border-bottom: 1px dashed black
h2 {
  width: 100%;
  text-align: center;
  border-bottom: 1px dashed #000;
  line-height: 0.1em;
  margin: 10px 0 20px;
}

h2 span {
  background: #fff;
  padding: 0 40px;
  border-bottom: 1px dashed black;
}

答案 1 :(得分:0)

您应该尝试这样的事情:

max_number_of_zeros = 2
df  = df.loc[:,len(df.columns) - df.astype(bool).sum(axis=0) < max_number_of_zeros]
print (df)
   0  2
0  1  0
1  2  1
2  0  3
3  1  1
    h2 { 
        width:100%;
        text-align:center;
        border-bottom: 1px solid #000;
        line-height:0.1em;
        margin:10px 0 20px; 
    } 
    h2 span { 
        background:#fff; 
        padding:0 10px;
        border: 1px solid #000;
        border-top-width: 0;
        border-left-width: 0;
        border-right-width: 0;
    }

此示例带有 <h2><span>THIS IS A TEST</span></h2>边框,如果需要虚线边框,可以使用solid进行更改。

答案 2 :(得分:0)

HTML代码:

<div class='white-line'></div>
    <div  class='line-title text-center' >
    <span class='bg-black'>THIS IS A TEST</span>
</div>

CSS代码:

.white-line{ height: 0; border-top: 1px;}
.bg-black{ background-color: #000000; }