skip to Main Content

I need to reduce the vertical spacing between the <asp:ListItem>. I tried giving style="margin-bottom=5px and margin-top: 5px;" but it is not working. how to do it?

<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>

I tried using

style="margin-bottom=5px;"

style="margin-top: 5px;"

style="height:5px;"  

and other options, but it is not working. How to do it?

2

Answers


  1. Chosen as BEST ANSWER
    <asp:ListItem runat="server">None</asp:ListItem>
    <asp:ListItem runat="server" style="float:left; margin-top: -10px;">Coding Restriction Based</asp:ListItem>
    <asp:ListItem runat="server" style="float:left; margin-top: -10px;">Transaction Type & Vendor Based</asp:ListItem>
    

    These changes got me the fixes I want


  2. You must have some other stray css in effect.

    However, try this:

            <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>
    

    Above shows and renders as this:

    enter image description here

    I don’t think you can have any "less" spacing between each line then above unless you start using a smaller font.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search