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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:39:43+00:00 2026-05-29T10:39:43+00:00

Hi all, vertical-align:middle is not working in div. Can you please check the bug

  • 0

Hi all,
vertical-align:middle is not working in div. Can you please check the bug in my code. I want to align the text with in DIV tag without using top,left properties.Please reply as soon as possible…..
Thanks in advance,

Here is my code…..

 <!DOCTYPE HTML>
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <style>
    body{
    font-size:0.7em;
    font-family:Arial;
    }
    .TimeFrame,.YearFrame,.QuarterFrame,.MonthFrame,.Year,.Quarter,.Month,.PrevYear,.NextYear{
     position:absolute;
     height:20px;
    }
    .YearFrame,.QuarterFrame,.MonthFrame{
      border:1px solid black; 
      border-radius:4px;   
    }
    
    .TimeFrame{
     top:10px;
     width:716px;
    }
    
    .YearFrame{    
      width:145px;  
      left:17px;
    }
    
    .QuarterFrame{
      width:121px;  
      left:200px;
    }
    
    .MonthFrame{
     width:439px;
     left:330px;
    }
    
    .Year,.Quarter,.Month{
      cursor:pointer;
      border-right:1px solid black;
      vertical-align:middle;
    }
    .Year{
     padding:0px 8px; 0px 8px;
    }
    .Quarter{
     padding:0px 5px; 0px 5px;
    }
    
    .Month{
     padding:0px 6px; 0px 6px;
    }
    
    .PrevYear{
      left:0px;
      top:2px;
    }
    .NextYear{
      left:165px;
      top:2px;
    }
    
    </style>
    </HEAD>
    
    <BODY>
    <div class="TimeFrame">
    <div class="PrevYear"><img src="round_arrow_left.png" alt="Previous" title="Previous"></div>
    
    <div class="YearFrame">
     <div class="Year" style="left:1px;">2000</div>
     <div class="Year" style="left:49px;">2001</div>
     <div class="Year" style="left:97px;border:none;">2002</div> 
    </div>
    <div class="NextYear"><img src="round_arrow_right.png" alt="Next" title="Next"></div>
    
    <div class="QuarterFrame">
     <div id="Q1" class="Quarter" style="left:1px;">Q1</div>
     <div id="Q2" class="Quarter" style="left:31px;">Q2</div>
     <div id="Q3" class="Quarter" style="left:61px;">Q3</div>
     <div id="Q4" class="Quarter" style="left:91px;border:none;">Q4</div>
    </div>
    
    <div class="MonthFrame">
     <div id="JAN" class="Month" style="left:1px;">Jan</div>
     <div id="FEB" class="Month" style="left:37px;">Feb</div>
     <div id="MAR" class="Month" style="left:74px;">Mar</div>
     <div id="APR" class="Month" style="left:111px;">Apr</div>
     <div id="MAY" class="Month" style="left:146px;">May</div>
     <div id="JUN" class="Month" style="left:185px;">Jun</div>
     <div id="JUL" class="Month" style="left:221px;">Jul</div>
     <div id="AUG" class="Month" style="left:252px;">Aug</div>
     <div id="SEP" class="Month" style="left:290px;">Sep</div>
     <div id="OCT" class="Month" style="left:328px;">Oct</div>
     <div id="NOV" class="Month" style="left:363px;">Nov</div>
     <div id="DEC" class="Month" style="left:401px;border:none;">Dec</div>
    </div>
    </div>
    </BODY>
    
    </HTML>
  • 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-29T10:39:44+00:00Added an answer on May 29, 2026 at 10:39 am

    It’s possible to use vertical-align:middle combined with display:table-cell to achieve this effect.

    I wrapped each of your Years in a span and used this CSS:

    .Year {
      display:table;
    }
    .Year span {
      display:table-cell;
      vertical-align:middle;
    }
    

    See fiddle here: http://jsfiddle.net/stephendavis89/7QPx8/1/ (only the years are vertically centered)

    P.S. You might want to consider left floating your years, quarters, and months instead of left positioning them.

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

Sidebar

Related Questions

All, I have the following code: <span style=width:450px; height:207px; display:inline-block; vertical-align:middle; padding:0 0 0
Having problem in IE8 with vertical align for images not working when a table
All I want is a pragmatic random number generator in C# so I can
All I want is to get the website URL. Not the URL as taken
I display some text but not all of the text is shown so I
I have User Control <table style=border-width: 0> <tr> <td style=vertical-align: middle;> <asp:RadioButton ID=rdOption runat=server
All I need this for is strcpy(). I want to see whether the first
All it does is output 'CHECK' which I put in to make sure it
All Points are Vectors, and all Vectors are Points. All Directions are Vectors, NOT
I used a padding in select list of gender but its not working in

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.