[RESOLVED]CSS question

I have a table in this format

<table>
<tr>
     <td>
          <asp: RadioButton
     </td>
     <td>
          <asp: RadioButton
     </td>
</tr>
</table>

It’s being distorted by the css below, I think because when it renders the RadioButton the text inside the Radiobutton is a label.  I also hit f12 and clicked on the text of the radiobutton which is a label and unchecked width and display below and it corrected
to the way I want it to be but I can’t touch that css below.  Does anyone know how to fix this without removing the css?  I can add to the css but can’t remove anything.

.layout label {
display: inline-block;
margin-right: 3px;
text-align: right;
width: 150px;
}
<div class="layout striped">
     <div class="twoColumn" >                     
          <asp:ContentPlaceHolder ID="MainContent" runat="server"> 
		</asp:ContentPlaceHolder>
     </div>
</div>

Try using the below css style to remove the space between your Radiobutton and text

<style>
            .layout label
            {
                display: inline-block;
                margin-right: 3px;
                text-align: right;
                width: 150px;
            }
            
            label, input[type="radio"]
            {
                /* Change the width value as per your text content */
                 width: 30px !important;
            }
        </style>

Complete Code:

<style>
            .layout label
            {
                display: inline-block;
                margin-right: 3px;
                text-align: right;
                width: 150px;
            }
            
            label, input[type="radio"]
            {
                /* Change the width value as per your text content */
                 width: 30px !important;
            }
        </style>
        <div class="layout striped">
            <div class="twoColumn">
                <table>
                    <tr>
                        <td>
                            <asp:RadioButton ID="RadioButton1" runat="server" Text="Radio1" />
                        </td>
                        <td>
                            <asp:RadioButton ID="RadioButton2" runat="server" Text="Radio2"  />
                        </td>
                    </tr>
                </table>
            </div>
        </div>

Leave a Reply