Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 465817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:24:57+00:00 2026-05-12T23:24:57+00:00

I have the following element on my form: <li> <label class=fixed for=Interests>Program genre interests:</label>

  • 0

I have the following element on my form:

<li>
    <label class="fixed" for="Interests">Program genre interests:</label>
    <label for="Sports"><%=Html.CheckBox("Sports")%>Sports</label>
    <label for="Comedy"><%=Html.CheckBox("Comedy")%>Comedy</label>
    <label for="News"><%=Html.CheckBox("News")%>News</label>
    <label for="Drama"><%=Html.CheckBox("Drama")%>Drama</label>
    <label for="Reality"><%=Html.CheckBox("Reality")%>Reality</label>
    <label for="Kids"><%=Html.CheckBox("Kids")%>Kids'</label>
</li>

The “fixed” class simply makes the label an inline block with a fixed width (to align the fields properly). The problem shows up if the check boxes are forced to wrap for whatever reason, because the second row of check boxes starts back underneath the label, rather than left aligned with the first row of check boxes.

I’m trying really hard to minimize the necessary markup / styling here, but I’m not sure the most efficient way to achieve the alignment I’m looking for. What I’m getting is:

label text here:    cb1, cb2, cb3, cb4
cb5, cb6, cb7, etc...

And what I want is

label text here:    cb1, cb2, cb3, cb4
                    cb5, cb6, cb7, etc...

What is the shortest / simplest html / css to achieve this?

Edit: I should note that I’m trying to avoid using floats because the rest of the page will contain some floated elements and I’ve had issues with nested floats before.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:24:58+00:00Added an answer on May 12, 2026 at 11:24 pm

    I’m affraid the only way to achieve this is to wrap all your checkboxes into a div element:

    <li>
        <label class="fixed" for="Interests">Program genre interests:</label>
        <div class="checkboxes-wrapper">
          <label for="Sports"><%=Html.CheckBox("Sports")%>Sports</label>
          <label for="Comedy"><%=Html.CheckBox("Comedy")%>Comedy</label>
          <label for="News"><%=Html.CheckBox("News")%>News</label>
          <label for="Drama"><%=Html.CheckBox("Drama")%>Drama</label>
          <label for="Reality"><%=Html.CheckBox("Reality")%>Reality</label>
          <label for="Kids"><%=Html.CheckBox("Kids")%>Kids'</label>
        </div>
    </li>
    

    And use the following CSS:

    .fixed, .checkboxes-wrapper { float:left }
    .checkboxes-wrapper { width: 200px; } /* 200px should be replaced by whatever size you want it to be */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html: <div class=bf_form_row> <label for=findout>Text goes here</label> <textarea class=findOut cols=40
I have the following dynamically created HTML block: <form class=standard settingsPage method=post enctype=multipart/form-data name=account
I have the following part of my form: <input type=checkbox class=hide id=additional-webinar name=additional-webinar-check value=additional-webinar-box>
I have the following code... <h3>Guests</h3> <form class=form-inline> <fieldset> <label class=control-label for=input01>First Name:</label> <input
I have a simple MVC form with the following elements: <%= Html.TextBox(FechaInicio) %> Which
If I have the following simplistic form: <?php class Application_Form_Contact extends Zend_Form { public
I have the following Zend_Form code to apply to form element decorators: $decorators =
I have the following form declaration: <div class=edit-dialog span-10 style=display:none;> <div class=edit-message span-10 style=margin-bottom:30px;>
I have the following form <form id=myform method=post action=#> <div class=fields> <fieldset class=ui-widget ui-widget-content
I have 15 form elements on my page in the following format: <tr> <td

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.