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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:40:20+00:00 2026-06-04T11:40:20+00:00

I made box and I set line-height, the text is automatically vertically center. Is

  • 0

I made box and I set line-height, the text is automatically vertically center. Is there a way or any kind of trick to set the text on the bottom of the box?

div {
    width: 100px;
    height: 100px;
    background: #eee;
    color: #333;
    text-align: center;
    line-height: 100px;
    vertical-align: text-bottom;
 }

<div>FoxRox</div>
  • 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-04T11:40:21+00:00Added an answer on June 4, 2026 at 11:40 am

    2020 Update

    You can use CSS grid, flexbox or the original method with line-height:

    body { display: flex } /* just to prettify */
    
    div {
      margin: .5em;
      width: 6.25em; height: 6.25em;
      background: #eee;
      color: #333;
      text-align: center
    }
    
    .grid {
      display: grid;
      align-content: end;
    }
    
    .flex {
      display: flex;
      align-items: flex-end;
      justify-content: center
    }
    
    .lh { line-height: 11.5 /* 6.25*2 - 1.5 */ }
    <div class='grid'>Hello</div>
    
    <div class='flex'>Hello</div>
    
    <div class='lh'>Hello</div>

    Setting the height of the div and the line-height of the text to the same value, 100px in your case, is a method of vertically centering the text within the div. That’s the problem.

    The solution is to change line-height to twice the height minus the size of the text and remove useless vertical-align.

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

Sidebar

Related Questions

The situation: There a collapsible advanced search box. It is made up of a
I made a custom text box yesterday with its own validator: public partial class
I have made one custom user control (search text box), which basically consists of
How can I set the height (dynamically) of the yellow <div id=box> to fit
i have a container box that includes a number of thumbnails. i earlier made
I've currently got a div tag with several text rules set, p, h1, h2...
I have made a chat box like thing in PHP. The only problem is
Hi I have made checked List Box in WPF but the binding is not
I have a custom dialog box displaying some text and a image underneath. The
i made check box in wpf ,Got it from Internet.I want to see which

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.