Asp:CheckBox checkbox and text are not on the same line

后端 未结 1 584
悲哀的现实
悲哀的现实 2020-12-19 07:46

I can\'t seem to figure out how to get the checkbox and associated text to appear on one line. The text is very short so it doesn\'t seem to be a width issue. I tried settin

相关标签:
1条回答
  • 2020-12-19 08:13

    You want to have display:inline applied to the <label> element that ASP generates to hold the label text, not the control itself. So, for example:

    <style type="text/css">
        label { display: inline-block; }
    </style>
    <asp:CheckBox Text="This text appears on same line as checkbox" runat="server" />
    
    0 讨论(0)
提交回复
热议问题