thi*_*dot 15
请参阅: http ://jsfiddle.net/thirtydot/jm4VQ/
如果文本需要换行,这将无效.在IE7中,没有行.
HTML:
<h2><span>Centered Header Text</span></h2>
Run Code Online (Sandbox Code Playgroud)
CSS:
h2 {
text-align: center;
display: table;
width: 100%;
}
h2 > span, h2:before, h2:after {
display: table-cell;
}
h2:before, h2:after {
background: url(http://dummyimage.com/2x1/f0f/fff&text=+) repeat-x center;
width: 50%;
content: ' ';
}
h2 > span {
white-space: nowrap;
padding: 0 9px;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11555 次 |
| 最近记录: |