• 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.
  • Posts

    • Windows 11 blocks Google Chrome due to a Microsoft safety feature, fix out by Sayan Sen Microsoft has a parental control and safety feature called "Microsoft Family Safety" which allows users to create safe spaces for their family members for browsing the web by setting up filters so as to block and filter inappropriate content and limit browsing to kid-friendly and family friendly content. However, as it turns out, following Chrome version updates 137.0.7151.68, 137.0.7151.69, Google's web browser is getting automatically blocked by Microsoft Family Safety as affected users have reported that the browser will automatically close or crash and then fail to reopen. Thus if you are using Edge, you get the green signal from the Family Safety app, but not if you are using Google Chrome. The issue seems to be affecting mainly Windows 11 devices but Windows 10 or macOS may be affected too. A thread on Microsoft's official Windows forum by Peter Priestley1, which is presumably from an educational institute, says: The thread has been upvoted by 122 people at the time of writing. There are plenty of other such threads online and users also say that they have tried all sorts of things like refreshing cookies and appdata but "nothing" seems to fix it. This shows that Microsoft's safety feature is certainly robust and that it is not easy to bypass but it also means affected users are not too happy about it considering it is seemingly blocking all versions of Chrome. There is one fix that worked though, renaming chrome.exe to something else like chrome1.exe for example. A Chrome community manager, Ellen T, has confirmed that the Microsoft feature is indeed what is causing it and the only way to fix the issue is to "unblock Chrome" inside the Family Safety app. Ellen says: Microsoft has also shared a similar guidance on the issue according to Fred SR., a senior member of the Chrome community.
    • Typical Microsoft... Go half way and then lazily stop. As if adding all the other directional options would have been so difficult...
    • Some of these robots are getting pretty human-like, but obviously stronger and more bendy. Weight and balance is probably a big hurdle because of all the batteries they have to pack in them, but it'll continue to improve. I'm guessing these companies foresee a future where every household has a robot slave...I mean, assistant.
  • Recent Achievements

    • Week One Done
      Helen Shafer earned a badge
      Week One Done
    • First Post
      emptyother earned a badge
      First Post
    • Week One Done
      Crunchy6 earned a badge
      Week One Done
    • One Month Later
      KynanSEIT earned a badge
      One Month Later
    • One Month Later
      gowtham07 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      660
    2. 2
      ATLien_0
      270
    3. 3
      Michael Scrip
      218
    4. 4
      Steven P.
      162
    5. 5
      +FloatingFatMan
      159
  • Tell a friend

    Love Neowin? Tell a friend!