• 0

[ASP.NET] checkboxes and line breaks


Question

Ok is there a way css-wise or other to remove the line break that occurs between the checkbox and the text when you use an asp.net checkbox?

When I add a CheckBox object to my page, it is rendered like this..

<span title="some text">
<input id="someID" type="checkbox"  name="someName" />
<label for="someID">title text</label>
</span>

I don't want the input and label to appear on different lines...is there css to prevent this?

Link to comment
https://www.neowin.net/forum/topic/377885-aspnet-checkboxes-and-line-breaks/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

The presence of a linebreak in the source shouldn't* make any difference to the rendered output as there isn't a specific break. As it is ASP.NET putting this HTML into the source, CSS doesn't apply as it isn't rendering anything yet. The only way to make the control not put a linebreak into the source is to override it with your own variety.

* Except we all know how crap IE is about rendering linebreaks when it shouldn't :huh:

  • 0
  lunamonkey said:
what css do you have?

They are both inline elements, so should appear side by side.

586589472[/snapback]

Let me look at the html again to verify that there isn't any css interfering...because from what you are saying, it seems like there is..

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.