我有一个看起来像这样的 div:
我想减少行之间的字距。我尝试将 line-height 指令添加到包含的 div 和标签元素之一,如下所示:
<div class="row" id="gadsDiv" runat="server" style="display: none; border-style: solid; margin-left:
4px; font-weight: bold; line-height:2px;">
<asp:Label runat="server" ID="lblMovieTitle" Style="color: blue">Movie Title
Unknown</asp:Label><label style="font-weight: bold; padding-left: 4px; padding-right: 4px;
line-height:2px;"> GENRES: </label>
<asp:Label runat="server" ID="lblGenres">None or Unknown</asp:Label>
<label style="font-weight: bold; padding-left: 4px; padding-right: 4px;">ACTORS: </label>
<asp:Label runat="server" ID="lblActors">None or Unknown</asp:Label>
<label style="font-weight: bold; padding-left: 4px; padding-right: 4px;">DIRECTOR[S]: </label>
<asp:Label runat="server" ID="lblDirectors">None or Unknown</asp:Label>
<label style="font-weight: bold; padding-left: 4px; padding-right: 4px;">WRITER[S]: </label>
<asp:Label runat="server" ID="lblScreenwriters">None or Unknown</asp:Label>
</div>
……但这没什么区别。
我需要做什么才能垂直“皱起”线条?
更新
奇怪的是,当我查看源代码时,我添加到 div 样式(以及边距)的 line-height 被消除了:
<div id="gadsDiv" class="row" style="display:block;background-color:
lightyellow;border: 2px solid blue;">
<span id="lblMovieTitle" style="font-weight: bold;font-size: large;color:
blue;">TO KILL A MOCKINGBIRD -- </span><label style="font-weight:
bold; padding-left: 4px; padding-right: 4px;line-height:2px;">
GENRES: </label>
<span id="lblGenres">Crime, Drama </span>
<label style="font-weight: bold; padding-left: 4px; padding-right:
4px;">ACTORS: </label>
<span id="lblActors">Gregory Peck, John Megna, Frank Overton, Rosemary
Murphy </span>
<label style="font-weight: bold; padding-left: 4px; padding-right:
4px;">DIRECTOR[S]: </label>
<span id="lblDirectors">Robert Mulligan</span>
<label style="font-weight: bold; padding-left: 4px; padding-right:
4px;">WRITER[S]: </label>
<span id="lblScreenwriters">Horton Foote</span>
</div>