How do you stop RadioButtonList Label text from wrapping under the button

Mark Dickinson picture Mark Dickinson · May 8, 2009 · Viewed 22.9k times · Source

I have a radio button list and some of the labels are quite long so they wrap and the second line appears underneath the radio button. Ideally I would like the text to wrap with the second line starting beneath the first character of the first line.

Any ideas on how? or would I have to make my own list based control for this?

Answer

Jose Basilio picture Jose Basilio · May 8, 2009

This CSS actually does the trick:

<style type="text/css">
 table.radioWithProperWrap input
 {    
      float: left;
 }

 table.radioWithProperWrap label
 {    
      margin-left: 25px;
      display: block;
 }
</style>
<asp:RadioButtonList runat="server" CssClass="radioWithProperWrap" ....>