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 8269525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:15:38+00:00 2026-06-08T06:15:38+00:00

I have several elements in HTML that I want to keep grouped when they

  • 0

I have several elements in HTML that I want to keep grouped when they wrap. I think the answer lies with some CSS (or maybe even JavaScript), but I’m not sure. For example, I have several elements laid out like this:

<label A><input A><label B><input B><label C><input C>

What happens is the users sometimes resize the browser window, and we end up with this:

<label A><input A><label B>
<input B><label C><input C>

In the example above, the input B isn’t next to its input element. Is there a way to group the label and the input so they wrap together? I’ve tried divs and putting the elements together in a table with “nowrap”, with mixed results. I don’t mind the lines wrapping, I just need to keep the label and input element together.

  • 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-06-08T06:15:40+00:00Added an answer on June 8, 2026 at 6:15 am

    It may also be worth looking at setting parent divs around each pair you wish to keep together – I know you said you tried this but also give them a fixed width and display:inline; and it should work

    ALSOO include float:left/right;(choose only one) This way, if the browser window is too small to show them all side by side, it will instead take the end pair and drop it onto the next line but should keep all elements within together and side by side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have several common elements (components), that will generate some html. it seems my
I have several HTML elements (buttons) that fire the same JQuery AJAX request. When
I have a form in HTML, that has several select elements, what is the
Assume that I have some HTML page, and a corresponding CSS file. I'd like
I have created several UI elements in the viewDidLoad method. I want to change
I've got several elements on a HTML page which have the same class -
I have in an HTML page, an element that appears several times, and running
Suppose I have a XML schema and want to support some extensions at several
I have a site that uses for example html element id=some_id several times and
I have several html input elements which all look something like this: <input id=1

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.