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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:34:32+00:00 2026-06-15T19:34:32+00:00

I have a blue box on a page that is 100 px from the

  • 0

I have a blue box on a page that is 100 px from the top and left. Then I want text in the blue box to vertically align. Why won’t my code below vertically align the text?

<!DOCTYPE html>
<html>
        <body>
                <div style="height:200px; background:blue; display:table-cell; vertical-align:middle; color:white;position:absolute; top:100px; left:100px;">
                        this is text;
                </div>
        </body> 
</html>

How do I get the text to vertically align?

Notes – If I remove position absolute, then the text vertically aligns. But this is not acceptable, because I need absolute positioniong for some other things.

  • 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-15T19:34:33+00:00Added an answer on June 15, 2026 at 7:34 pm

    Contain it in a separate div like this:

    CSS

    #Div0 {
        position:absolute; 
        top:100px; 
        left:100px;
    }
    
    #Div1 {
        height:200px; 
        background:blue; 
        display:table-cell; 
        vertical-align:middle; 
        color:white;
    }
    

    HTML

    <div id="Div0">
        <div id="Div1">
            this is text
        </div>
    </div>​​​​​​​​​​​​​​​​​​​
    

    Solution Example: http://jsfiddle.net/rgDfg/

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

Sidebar

Related Questions

I have Textbox with blue Background and white Foreground . When entering a text
I have with an blue tooth application from android api sample.I am displaying blue
I have the following page: <!DOCTYPE html> <html> <head> <style type=text/css> html, body {
I want to the user to select an option from a drop down box
I'd like to have the box shows in the middle of the page, I
I have a page that has 7 image boxes, these boxes are alert boxes
This is what I have: http://jsfiddle.net/kRUBY/ <style> div.box { width:400px; height:200px; float:left; } </style>
I want to append the dropped item into the targeted droppable box from the
I have a page with some clickable <div> elements, and I want to change
I have one image and text that goes along with it to the side

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.