html - 为什么LI有这么多空间

标签 html css

<div id="patTest">
    <ul id="patTestUL">
        <li>
            <div class="dvInnerLI">
                <span class="spnImgLI"><img src="theImages/leftQuote.png" alt="Quote" style="width: 15px; height: 15px; padding-right: 10px;" /></span>
                <span class="spnTextLI">It is a great medical group; staff is very accommodating to patient needs.</span>
            </div>
        </li>
        <li>
            <div class="dvInnerLI">
                <span class="spnImgLI"><img src="theImages/leftQuote.png" alt="Quote" style="width: 15px; height: 15px; padding-right: 10px;" /></span>
                <span class="spnTextLI">@WG has the nicest doctors & staff! #A+.</span>
            </div>
        </li>
        <li>
            <div class="dvInnerLI">
                <span class="spnImgLI"><img src="theImages/leftQuote.png" alt="Quote" style="width: 15px; height: 15px; padding-right: 10px;" /></span>
                <span class="spnTextLI">Thanks @WG #Yonkers in & out in 15 minutes to have my blood taken. The nurse was fabulous, too!</span>
            </div>
        </li>
    </ul>
</div>

#patTestUL {
    width: 100%;
    margin: auto;
}
#patTestUL li {
    margin: 0;
    padding: 0;
}
.dvInnerLI {
    padding: 0;
    margin: 0;
    width: 98%;
    text-align: center;
}
.spnImgLI {
    width: 20%;
    text-align: right;
}
.spnTextLI {
    color: #000000;
    width: 76%;
    display: inline-block;
    vertical-align: top;
    margin-top: 5px;
    border-bottom: 2px solid #CEE9F6;
    padding-bottom: 4px;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}

enter image description here

试图弄清楚文字和上面的蓝线之间哪里有那么大的空间。

leftQuote 图片:

enter image description here

如何修改使蓝线上下的空间相同?

来源显示:

enter image description here

最佳答案

那条蓝线来自 spnTextLI 类的 border-bottom 属性。它与上面的文本如此接近的原因是因为边框来自该文本所在的 div。

如果您增加 spnTextLI 类的 padding-bottom 属性,边框将被推得离它上面的文本更远。

关于html - 为什么LI有这么多空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24916715/

相关文章:

svg - 一个 SVG 文件,里面有很多 SVG 渐变

html - CSS 居中和垂直对齐

html - 为什么 float 不使文本换行?

javascript - Angular JS 中的 Promise 对象未呈现错误

javascript - jquery搜索删除表格行

html - 为什么我的内容宽度小于 100%?

jquery - 没有显示大图 (prev() click()attr())

css - Bootstrap 轮播超链接不起作用

css - 如何使用 CSS 将 n 列居中?

Jquery 动画从右下角到