1

在图片标题“账户和控股披露中越过白线而 DRF 远高于白线...

在此处输入图像描述

如何使用 css 将文本放在行上方。

html代码是

         <div class="tabs">
            <img src="images/disclosure.png" />
            Accounts and Holdings Disclosure</div>
        <div class="tabs">
            <img src="images/drf.png" />
            DRF</div>

CSS是

.tabs
{
height: 85px;
border-bottom: 1px solid #fff;
text-align: center;
color: #fff;
padding-bottom:7px;
}
.tabs img
{
display: block;
margin-left: auto;
margin-right: auto;
height: 70px;
margin-top: 5px;
}
4

3 回答 3

1

你应该写:

.tabs {
  height: auto;
}
于 2013-02-13T08:14:51.947 回答
1

第一个块中根本没有足够的空间来应用填充。.tabs 高度为 85px,图像高度为 70px,顶部边距为 5px。因此,文本的剩余垂直空间仅为 10 像素,并且添加了 7 像素的填充。

在我看来,您需要减小图像的大小。

于 2013-02-13T08:16:17.157 回答
0

应该 :

.tabs {
   height: 90px;
}
于 2013-02-13T08:17:24.137 回答