0

I am using 3 radio buttons in my User Control, I need to add space between the Radio Buttons, not between the text or button and its text, but between the buttons, could you please help me how can I add space between the Radio Buttons, my User Control list is as follows

public class RadioButtonListAppointmentFormat : MyCalSTRSRadioButtonList
{
    public RadioButtonListAppointmentFormat(): base()
    {
        this.CellPadding = 0;
        this.CellSpacing = 0;

        Items.Add(new ListItem("In Person", "InPerson"));
        Items.Add(new ListItem("Telephone", "Telephone"));
        Items.Add(new ListItem("Web Based", "Web"));

        SelectedIndex = 0;
        this.SetDisplayTextToNoWrap();
    }
}

Base class for our User Control

public class MyCalSTRSRadioButtonList : BaseRadioButtonList
{
    public MyCalSTRSRadioButtonList() : base()
    {
        this.CssClass = ApplicationSettings.CssClass.FormText;
    }
}

this is the CSS it is using

.formtext {
    font-size: 1.1em;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    line-height: 22px !important;
}

And following is to attach the css to the User Control

public static string FormText
 {
     get { return "formtext"; }
 }

Any help is greatly appreciated please

3
  • 2
    It would be better to post just the relevant HTML and CSS.
    – ralph.m
    Commented Oct 11, 2023 at 22:50
  • That's all I have ralph
    – Abdul
    Commented Oct 11, 2023 at 23:26
  • 1
    What @ralph.m means is that to troubleshoot the problem we need to start not with your source code, but with the generated code being sent to the browser. Use your browser inspector and copy the HTML/CSS from there into your question. Commented Oct 11, 2023 at 23:30

1 Answer 1

2
 .formtext {
    font-size: 1.1em;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    line-height: 22px !important;
    }

.formtext input[type="radio"] {
    margin-right: 10px; /* Puedes ajustar el valor según sea necesario */
  }
2
  • Thank you so much Cristian, what shall I do to apply this change only to the elements of this User Control not on other controls, how should I call this in.cs file, should I create a different property? Thank you so much my friend.
    – Abdul
    Commented Oct 12, 2023 at 2:37
  • Hi Cristian for some reason its not reflecting on the UI my friend, even when I added margin-right: 10px; to the .formtext and .formtext input in both cases, UI remain the same, any help my friend why its not updating the UI, I cleared the Cache also.
    – Abdul
    Commented Oct 12, 2023 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.