2014-01-08 41 views

回答

1

在你的CSS代码补充一点:

.or{ 
    display: block; 
    width: 100%; 
    text-align: center; 
} 

demo

+0

谢谢你!像一个魅力工作 –

+0

@RyanSalmons:欢迎,并接受答案:) – Fox

+0

@RyanSalmons如果你对此感到满意,那么请接受答案 –

0

这里比答案另一种方法,只是在案件。

HTML

<div class="container"> 
    <hr class="floatLeft splitHR" /> 
    <span class="floatLeft or"> OR </span> 
    <hr class="floatLeft splitHR" /> 
    <div style="clear:both;"></div> 
</div> 

CSS

.floatLeft { 
    float:left; 
} 
.splitHR { 
    width: 45%; 
} 
.or { 
    width: 9%; 
    text-align: center; 
} 
.container { 
    width:100%; 
}