我需要减少<asp:ListItem>

问题描述 投票:0回答:1

我需要减少 之间的垂直间距。我尝试给出 style="margin-bottom=5px 和 margin-top: 5px;"但它不起作用。怎么办?

<asp:RadioButtonList ID="rblGlobalConfidential" runat="server" 
     RepeatDirection="Vertical"  AutoPostBack="false"
     onChange="ConfidentialTypeChange();" Font-Bold="true" Font-Size="Medium">
    <asp:ListItem>None</asp:ListItem>
    <asp:ListItem>Coding Restriction Based</asp:ListItem>
    <asp:ListItem>Transaction Type & Vendor Based</asp:ListItem>
</asp:RadioButtonList>

我尝试使用

style="margin-bottom=5px;"

style="margin-top: 5px;"

style="height:5px;"  

和其他选项,但它不起作用。怎么办?

html css asp.net telerik
1个回答
0
投票

您必须有一些其他有效的杂散CSS。

但是,试试这个:

        <style>
            .myspacing label,input {
               margin-bottom:-2px;
               margin-top:-2px;
               font-size:medium;     
            }
            .myspacing input {
                margin-right:10px;
            }
        </style>

        <asp:RadioButtonList ID="rblGlobalConfidential" runat="server"
            RepeatDirection="Vertical" AutoPostBack="false"
            CssClass="myspacing" >
            <asp:ListItem>None</asp:ListItem>
            <asp:ListItem>Coding Restriction Based</asp:ListItem>
            <asp:ListItem>Transaction Type & Vendor Based</asp:ListItem>
        </asp:RadioButtonList>

上面的显示和渲染如下:

我不认为你可以在上面的每行之间有任何“更小的”间距,除非你开始使用较小的字体。

© www.soinside.com 2019 - 2024. All rights reserved.