简体   繁体   中英

CSS - Border for list doesn't show

html:

<li>
    <a href="">text<span></span></a>
</li>

css:

ul{
    list-style:none
}
li{
  float: left  
}
a{
    padding: 10px;
    border: 1px solid #000;
}

In chrome the right border doesn't show up:

image: i.imgur.com/OycFyOk.png

FF and Safari works fine.

Example code in fiddle:

http://fiddle.jshell.net/yrntrapk/

You need to put display: block; to the "a" element:

a { display: block; }

删除HTML上的Empty span标签应该是对此的最快解决方法。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM