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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:02:50+00:00 2026-05-29T05:02:50+00:00

Simply enough I can’t get text to align to right in a <label> element.

  • 0

Simply enough I can’t get text to align to right in a <label> element.

HTML

<div id="contact_form">
 <label for="name" id="name_label">Name:</label>
 </div>

CSS

#contact_form label {
  text-align: right;
}

My page: http://freshbeer.lv/development/en/contact.php

You can see labels for name, phone, email etc… are aligned to the left, but I need them to be aligned to the right, so could anyone please suggest something?

  • 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-29T05:02:53+00:00Added an answer on May 29, 2026 at 5:02 am

    Label is an inline element – so, unless a width is defined, its width is exact the same which the letters span. Your div element is a block element so its width is by default 100%.

    You will have to place the text-align: right; on the div element in your case, or applying display: block; to your label

    Another option is to set a width for each label and then use text-align. The display: block method will not be necessary using this.

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

Sidebar

Related Questions

Since simply using Apache can be enough to run many Web applications, when and
Seems like a simple enough question but I can't seem to find the answer.
This should seem simple enough, but can't figure it out. I was porting a
Well, it seems simple enough, but I can't find a way to add a
We have a junior programmer that simply doesn't write enough tests. I have to
It is simple enough to put the outer text of an XML node in
Simply enough, I need to know how to obtain the current URL that the
Well, I was able to simply enough (after about an hour of googling) implement
I'm trying to simply prove here that this simple function isn't good enough to
I don't have enough memory to simply create a diagonal D-by-D matrix, since D

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.