2017-08-06 66 views
0

有人推薦我使用的字段集,但它沒有工作,爲什麼fieldset不能在我的wordpress中工作?

這裏是代碼

.block{ 
display: inline-block; 
border: 2px solid white; 
} 
.title2{ 
color: white; 
font-size: 1.5em; 
text-align: center; 
} 

<fieldset class="block"> 
     <legend class="title2"> 
       Services 
     </legend> 
</fieldset> 

它表明這樣

enter image description here

我想是這樣的

enter image description here

這裏是下劃線

enter image description here

回答

1

試試這個代碼:

因爲你的主題可以覆蓋您fieldset風格。您可以使用!important進行修復。

fieldset.block { 
 
    font-family: sans-serif!important; 
 
    border: 5px solid #1F497D!important; 
 
    background: #eee!important; 
 
    border-radius: 5px!important; 
 
    padding: 15px!important; 
 
} 
 
fieldset.block legend.title2 { 
 
    background: #1F497D!important; 
 
    color: #fff!important; 
 
    padding: 5px 10px!important; 
 
    font-size: 32px!important; 
 
    border-radius: 5px!important; 
 
    box-shadow: 0 0 0 5px #ddd!important; 
 
    margin-left: 20px!important; 
 
}
<fieldset class="block"> 
 
    <legend class="title2">Services</legend> 
 
    <p>Some text.</p> 
 
</fieldset>

+0

仍然有文字 – Woshooo

+0

分享截圖下下劃線.. –

+0

如何分享給有何評論? – Woshooo

相關問題