Scarl
0
Q:

css text align center vertical

vertical-align: middle;
2
/* HTML: */
<div class="text">
lorem ipsum
</div>


/* CSS: */
.text {
vertical-align: middle;
/*can take any value of:
baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length> */
}

3

  .center {
  display: flex;
  justify-content: center;
  
  align-items: center;
  height: 200px;
  border: 3px solid 
  green; 
} 
3
<!DOCTYPE html>
<html>
   <head>
      ...
      <style type="text/css">
         div{
         width: 200px;
         height: 200px;
         border: solid green;
         display: table-cell;
         vertical-align: middle;
         }
      </style>
   </head>
   <body>
      <div>Vertikal ausgerichteter Text</div>
   </body>
</html>
1
DIV.container {
    min-height: 10em;
    display: table-cell;
    vertical-align: middle }
...
DIV {
  GeeksforGeeks
}
0

.center {
  padding: 70px 0;
  border: 3px solid 
green;
  text-align: center;

} 
-1

New to Communities?

Join the community