2013-07-22 40 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/ –

相关问题