-2

Here you can show an example of my code : Jsfiddle

<div id="gameTimeBar-holder">
<div id="gameTimeBar"></div>
<div class="progressBarText">Actions : 852 minutes</div>

#gameTimeBar-holder{width:200px;height:15px;background:grey; position:absolute; top:45px; left:5px;}
#gameTimeBar{width:0;height:100%;background:purple;}
.progressBarText{position:absolute;z-index:10;top:0;left:0;width:100%;text-align:left; color: white;}

How can i vertical center my text in the div progressBarText ?

Clément Andraud
  • 8,321
  • 22
  • 69
  • 140

1 Answers1

1

add line-height to your text
try this:

.progressBarText{
       position:absolute;
       z-index:10;
       top:0;
       left:0; 
       width:100%; 
       line-height:15px; 
       text-align:left; 
       color: white; 
   }

DEMO

Alessandro Minoccheri
  • 32,975
  • 19
  • 110
  • 159