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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:18:25+00:00 2026-06-11T18:18:25+00:00

I need to group two li elements together, so that if the height of

  • 0

I need to group two li elements together, so that if the height of any one li (Field7) in the group increases then the height of other one (Field6) should also increase (not its content: label, input), without affecting the height of other li elements (field1, 9, 10, etc.).

As of now I’ve implemented (see image) as follows:

#fld_grp {
    margin: 5px;
    border: 1px solid #008e9c;
    height: auto;
    overflow: hidden;
    padding-bottom: 10px;
}
#fld_grp div.row {
    display: table-row;
    height: auto;
    overflow: hidden;
}
#fld_grp .hd {
    padding-left: 5px;
    line-height: 25px;
    background: #008e9c;
    color: #FFF;
    font-weight: 500;
    font-size: 14px;
}
#fld_grp ul {
    clear: left;
    list-style-type: none;
    margin: 0;
    padding: 0;
    text-align: left;
    display: table;
}
#fld_grp ul li {
    width: 463px;
    margin: 5px;
    height: auto;
    min-height: 30px;
    float: left;
    list-style: none;
    background: rgba(0, 0, 0, 0.1);
}
#fld_grp ul li.dbl {
    width: 935px;
}
#fld_grp ul li label {
    width: 50%;
    background: rgb(255, 235, 205);
    display: block;
    padding: 5px 10px;
    float: left;
    counter-reset: sub-section;
}
#fld_grp ul li label:before {
    counter-increment: section;
    content: counter(section) ". ";
}
#fld_grp ul li input {
    text-align: start;
    width: 170px;
    height: 20px;
    margin: 2px 15px 0 20px;
    background: none repeat scroll 0 0 transparent;
    border: 1px dashed rgba(255, 228, 196, 0.7);
    cursor: text;
}
#fld_grp ul li input:hover {
    border: 1px solid rgba(255, 228, 196, 0.7);
}
#fld_grp ul li input:focus {
    background: antiquewhite;
    border: 2px solid rgba(127, 255, 212, 0.7);
}
<div id="fld_grp">
    <div class="hd">
        <h3>Field Group1</h3>
    </div>
    <ul>
        <div class="row">
            <li>
                <label>Field1</label>
                <input type="text">
            </li>
            <li>
                <label>Field2</label>
                <input type="text">
            </li>
        </div>
        <div class="row">
            <li>
                <label>Field3</label>
                <input type="text">
            </li>
            <li>
                <label>Field4</label>
                <input type="text">
            </li>
        </div>
        <div class="row">
            <li class="dbl">
                <label>Field5(full field)</label>
                <input type="text">
            </li>
        </div>
        <div class="row">
            <li>
                <label>Field6</label>
                <input type="text">
            </li>
            <li>
                <label>Field7:This Long Label is really very long!</label>
                <input type="text">
            </li>
        </div>
        <div class="row">
            <li>
                <label>Field8</label>
                <input type="text">
            </li>
            <li>
                <label>Field9</label>
                <input type="text">
            </li>
        </div>
        <div class="row">
            <li class="dbl">
                <label>Field10(full field)</label>
                <input type="text">
            </li>
        </div>
    </ul>
</div>

I need to get rid of the warnings Eclipse is giving me about in to make my site W3C-compliant for HTML4.01 standards. Moreover, I’m doomed to make it work on IE7.

enter image description here

After Andrew’s suggestion, here’s CSS that solves the issue:

#fld_grp{
    margin: 5px;
    border: 1px solid #008e9c;
    height:auto;
    overflow: hidden;
    padding-bottom: 10px;
}
#fld_grp .hd{
    padding-left: 5px; 
    line-height: 25px; 
    background: #008e9c; 
    color: #FFF; 
    font-weight: 500; 
    font-size:14px;
    }
#fld_grp ul{
    clear:left;
    list-style-type:none;
    margin:0;
    padding:0;
    text-align:left;
    word-wrap: break-word;
}
#fld_grp ul li{
    width:932px;
    margin: 5px;
    height: auto;
    min-height: 35px;
    float:left;
    list-style:none;
    background: rgba(0,0,0,0.1);
    border:1px dashed #8B4513;
    display:table;
}
#fld_grp ul li > div{
    width:466px;
    background:green;
    display:table-cell;
    height:auto;
    min-height:35px;
    float:left;
}
#fld_grp ul li > div label{
    width: 50%;
    background: rgb(255, 235, 205);
    display: block;
    padding: 8px 10px;
    float:left;
}
#fld_grp ul li > div input{
    text-align: start;
    height: 20px;
    margin: 2px 15px 0 20px;
    background: none repeat scroll 0 0 transparent;
    border: 1px dashed rgba(255, 228, 196, 0.7);
    cursor: text;
}
#fld_grp ul li> div.dbl{
    width: 932px;
}

Result:

Solved

  • 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-11T18:18:26+00:00Added an answer on June 11, 2026 at 6:18 pm

    Change your markup.

    Use an li for each row, and a div for each colum in the row.

    <ul>
        <li class="clearfix">
            <div>
                <label>Field1</label>
                <input type="text">
            </div>
            <div>
                <label>Field1</label>
                <input type="text">
            </div>
        </li>
    </ul>
    

    You could then float your div’s, and make them 50% to get the two columns.
    You would then need to apply a clearfix to your li’s though to force them to wrap the divs

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

Sidebar

Related Questions

I have a form that has a group of 3 text_fields. I need two
I've got a whole bunch of elements that I need to group, but because
I need to fetch a node set containing elements that refer to exactly two
I need to group by two different elements in my XML using XSLT. Here
I have got a group of radio buttons that when clicked need to display
can I group blocks in Drupal 6 ? I need to wrap two adjacent
I need to execute a query that joins two tables, groups by a value,
I need to synchronize a path animation on two different layers (one is used
I have a project which i need to build in two different configurations. One
I've got two documents - one is a custom XML file format, the other

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.