2013-07-22 73 views
-2

我有一個小小的設計問題。我想讓我的網站在它的頭兩邊有兩行。我如何爲我的網站做到這一點?

------------- Similar to this ----------------- 

我不知道我應該怎麼去了解這一點,我找不到任何網站實現它要能夠窺視到他們的HTML/CSS ..我應該怎麼做這個???謝謝

+10

'

---包頭---

' –

+1

看看[這裏](HTTP:/ /css-tricks.com/line-on-sides-headers/) –

+0

可能應該在搜索時在我的搜索中包含標題。謝謝! – user2605381

回答

0

標記:

<div class="section-heading"> 
    <h1>Your Heading</h1> 
</div> 

CSS:

.section-heading { 
    text-align: center; 
    margin-bottom: 15px; 
    border-bottom: solid 1px #dcdcdc; 
    position: relative; 
    top: -2.2em; 
} 
.section-heading h1{ 
    display: inline; 
    padding: 0 15px; 
    bottom: -15px; 
    position: relative; 
    background: #fff; 
} 

http://jsfiddle.net/9ss5h/

+0

你並不需要H1標籤或所有CSS的容器,你可以這樣做:http://jsfiddle.net/ZRPnk/ –

相關問題