在< li>标签 [英] Drawing lines in <li> tag

查看:142
本文介绍了在< li>标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个li元素,如下所示:

I do have an li element that looks like this:

|    Link    |

我想使用SOLID行成为这样:

I want it to become like this with a SOLID line:

|----Link----|

这是代码的链接:
http://jsfiddle.net/sh9hY/

我试过将hr标签放在li元素,并使hr在线,但失败。我的问题是,我需要线包裹文本。

I have tried putting a hr tag inside the li element and making the hr inline but that failed. The problem im having is that I need the line to wrap around the text. Im clueless on this one.

推荐答案

Here's another alternative.

<hr/><span>Link</span>


li span {
    background-color: #fff;
    color: #000;
}

hr {  
    border: none;
    color: #000;
    background-color: #000;
    height: 1px;
    margin-top: 9px;
    position: absolute;
    display: block;
    width: 100%;
    z-index: -1;
}

这篇关于在&lt; li&gt;标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆