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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:55:30+00:00 2026-06-09T16:55:30+00:00

I think this is a typical problem. I have following html <div class=editor-label>Group Name:

  • 0

I think this is a typical problem. I have following html

<div class="editor-label">Group Name:       </div>
<div class="editor-field"><input type="text"></input></div>

and css

.editor-label {
float: left;
width: 200px;
margin-bottom: 4px;
margin-right: 10px;
text-align: right;
}

.editor-field {
float: left;
width: 300px;
}

I think height of editor-field is different among browsers and controls. But problem is that text in editor-label is always aligned on top. What is the best way to vertically center that text?

In my descent experience with css, I think best way is to set height of editor-field and editor-label to same and to use vertical-align tag. But in this case, I am not sure I want to do that because height of editor-fields will vary. Any idea would be appreciated.

UPDATE:

I didn’t want to change exisiting html so I just used jquery to set line-height and be done with it.

$(document).ready(function () {
    $(".editor-label").css("line-height", $(".editor-field").css("height"));
});
  • 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-09T16:55:30+00:00Added an answer on June 9, 2026 at 4:55 pm

    line-height of .editor-label matching the height of .editor-field’s input would get you a label that’s always centered.

    Though I’m not sure if it’s your specific case, but that’s the whole point of the label element. You can do:

    <label>Group Name: <input type='text'/></label>
    

    And no matter the height of input, the label will always center. (You can add a margin-left on input for spacing)

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

Sidebar

Related Questions

Typical problem, but I've done everything I can possibly think of to get this
A typical problem in OO programming is the diamond problem. I have parent class
I met a problem like this. class A have a list of class B.
I think this could be a very easy question for you. But I have
I think this is a simple and a silly question. I have included a
I think this is a pretty straightforward problem but... var outerHeight = $('.profile').outerHeight(); $(#total-height).text(outerHeight
I think this is mostly because I'm new to PHP OOP, but I have
I have a typical table, e.g. id(int) name(varchar) address(varchar) date(datetime) I also have a
(I think this is a pretty basic question on OOP, but unfortunately I wasn't
I think this is easily explained by looking at code, so I'm posting a

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.