跨距之间的CSS空间线

Tom*_*len 3 css line spacing

我有这个结构:

<div class="gBigPage">
    <span class="gBigMonthShort">FEB</span><br />
    <span class="gBigDayShort">23</span><br />
    <span class="gBigYearShort">2011</span>
</div>
Run Code Online (Sandbox Code Playgroud)

文本行之间的间隙太大,我需要它们缩短,所以它们几乎都是触摸的.

/* Mouseover div for day numbers */
.gBigPage{
    height:45px;
    width:30px;
    font-family:Arial;
    font-weight:bold;
    background-color:#ffee99;
    text-align:center;
    border-top:1px solid #c0c0c0;
    border-left:1px solid #c0c0c0;
    border-right:1px solid #c0c0c0;
    position:absolute;
    z-index:3;
}
.gBigPage:hover{
    cursor:pointer;
}
/* In the big day box, the month at top */
.gBigMonthShort{
    text-transform:uppercase;
    font-size:11px;
}
.gBigYearShort{
    font-size:11px;
}
.gBigDayShort{
    font-size:16px;
}
Run Code Online (Sandbox Code Playgroud)

我无法对跨度进行相对定位,因为Chrome中存在一个闪烁鼠标悬停效果的错误,纯CSS是唯一可行的.

小提琴例如:http: //jsfiddle.net/GmKsv/

ryr*_*yan 7

你所需要的只是你的css中的线路高度.将此添加到您的gBigPage.

这是代码:

.gBigPage{
    height:45px;
    width:30px;
    font-family:Arial;
    font-weight:bold;
    background-color:#ffee99;
    text-align:center;
    border-top:1px solid #c0c0c0;
    border-left:1px solid #c0c0c0;
    border-right:1px solid #c0c0c0;
    position:absolute;
    z-index:3;
    line-height: 13px;
}
Run Code Online (Sandbox Code Playgroud)

演示jsFiddle

希望能帮助到你!