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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:13:55+00:00 2026-05-22T22:13:55+00:00

I have a form with a wrapping <label> element, but the space between the

  • 0

I have a form with a wrapping <label> element, but the space between the <label>‘s two lines is too big and I can’t seem to adjust the line-height of the <label>.

Here is an example of a <label> and a <p>, both with the same CSS applied. As you can see, the <p> adjusts correctly, while the <label> remains unchanged.

http://jsfiddle.net/QYzPa/

CODE:

form label,
form p
{    
  font-weight:bold;
  line-height:.7em;
}
<form style="width:200px;">
    <fieldset>
         <label for="textarea">In ten or fewer words, explain American history</label>
        <p>In ten or fewer words, explain American history</p>
        <textarea name="textarea" rows="5" ></textarea>
    </fieldset>
</form>
  • 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-22T22:13:56+00:00Added an answer on May 22, 2026 at 10:13 pm

    All the HTML tags are classified in categories that describe their nature. This classification can be related to semantics, behavior, interaction and many other aspects.

    Both p and label tags are classified in “flow content” tags category. But there is one slight difference between then: the label tag is also classified in a category called “phrasing content”.

    What do all this mean in practice? The browser default rendering will follow the specified tag classifications and will treat the p tag as a block element, while the label tag will, by default, be treated as an in-line element. You can modify this by overwriting the default CSS rule: just tell the browser that you want your label to be rendered like a block element.

    label {
      display: block;
    }
    

    You need to do that because elements that are in-line (display:inline) can’t have properties like height, line-height, margin-top, margin-bottom (they will be ignored).

    If you want an inline element to have a height property but still keep it with it’s inline behavior (without cause a LINE BREAK), you can declare it as:

    label{
     display:inline-block;
    }
    

    It’s always good to take a read at HTML ‘s documentation. Here is a nice graph showing the categories, it can save you a lot of time, specially when dealing with these small quirks.

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

Sidebar

Related Questions

i have form action file in another directory but some file send to this
I have form with one input for email and two submit buttons to subscribe
I have form where user submits field. Field can have letters, numbers, and punctuation.
I have form, where some fields are looks like rows, so I can add/delete
I have two inputs that together form a single semantic unit (think an hours
I have two forms on one page: a results form and a search form.
i have a form element- text input and a submit button- Im trying to
In an html form I have a checkbox that has a label. When you
I have a model named UserPrice which has a form where you can create
I have form area in my view. If I click button A , I

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.