开发者

CSS: How do I get rid of unintended space on top

开发者 https://www.devze.com 2023-03-17 02:02 出处:网络
See this pic: http://twitpic.com/5k3uph The CSS I use is: #content_filter_items { display: none; background-color: #ccc;

See this pic:

http://twitpic.com/5k3uph

The CSS I use is:

#content_filter_items {
    display: none;
    background-color: #ccc;
    padding: 3px;
    margin-bottom: 5px;
    clear: both; }

#content_filter_items .filter_item {
    display: inline-block;
    background-color: white;
    width: 200px;
    padding: 2px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    -o-border-radius: 5px;
    -ms-border-radius: 5px;
    -khtml-border-radius: 5px;
    border-radius: 5px;
    heig开发者_StackOverflow社区ht: 100px; }

Why is it that I have the extra space on top of the 2nd column?

Thanks Eric


Where you have display: inline-block, you also need to set vertical-align: top.

See the "baseline" section here for an explanation:

http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/

0

精彩评论

暂无评论...
验证码 换一张
取 消