+chorpeac MVC Posted September 27, 2005 MVC Share Posted September 27, 2005 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 More sharing options...
0 +mrbester MVC Posted September 28, 2005 MVC Share Posted September 28, 2005 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: Link to comment https://www.neowin.net/forum/topic/377885-aspnet-checkboxes-and-line-breaks/#findComment-586589450 Share on other sites More sharing options...
0 lnmnky Posted September 28, 2005 Share Posted September 28, 2005 what css do you have? They are both inline elements, so should appear side by side. Link to comment https://www.neowin.net/forum/topic/377885-aspnet-checkboxes-and-line-breaks/#findComment-586589472 Share on other sites More sharing options...
0 +chorpeac MVC Posted September 28, 2005 Author MVC Share Posted September 28, 2005 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.. Link to comment https://www.neowin.net/forum/topic/377885-aspnet-checkboxes-and-line-breaks/#findComment-586589692 Share on other sites More sharing options...
0 +chorpeac MVC Posted September 28, 2005 Author MVC Share Posted September 28, 2005 Ok I figured it out. It was a CSS action being applied, display:block. I changed the css a little and it was working like it should have. Link to comment https://www.neowin.net/forum/topic/377885-aspnet-checkboxes-and-line-breaks/#findComment-586590596 Share on other sites More sharing options...
Question
+chorpeac MVC
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..
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