- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI am looking to style the <input type="checkbox".../> and the <label for="myCheck">...</label> of an <asp:Checkbox/> through a CSS class.
When I apply a CssClass="TestClass" attribute to the control, i get the code below.
What would the CSS look like if I want the checkbox to appear on the same line as the label, but if the label wraps to the next line, it is indented to match the start of the label text.
What it looks like:
[] blah blah
blah
What I want:
[] blah blah
blah
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: locke_aPosted on 2009-08-13 at 09:46:59ID: 25090366
This looks like a hanging indent to me. I tried the following and it worked pretty well in my test, but may require additional markup.
First, I added a CSS class for the hanging indent (hang)
.hang { text-indent: -27px; margin-left: 27px; display:block; }
Then I applied this to the parent element of the checkbox and text in question:
<span class="hang"><input type="checkbox" /> asdf asd fasdf asdf asdf asd fasdf asdf asdf asd fasdf asdf asdf asd fasdf asdf asdf asd fasdf asdf asdf asd fasdf asdf asdf asd fasdf asdf asdf asd fasdf asdf asdf asd fasdf asdf</span>
To work right, the parent element must be a display:block; element. In your case, the parent is a span which by default is display:inline; so I added display:block; to the css. If this won't work because it messes up your other layout, you might have to add a div or p or something inside the div around the input and text (div and p are both block by default).
Hope this helps!