moudiz
0
Q:

vertically align

/* 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
/* Answer to: "css vertical align middle" */

/*
  Go to: https://www.w3schools.com/css/css_align.asp
  Here you can learn many ways to align horizontal and vertically!
  My favourite method is below:
*/

.center {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  border: 3px solid green;
}
5

    img.a {
  vertical-align: baseline;
}

img.b {
  vertical-align: text-top;
}

img.c {

      
    vertical-align: text-bottom;
}

img.d {
  
    vertical-align: sub;
}

img.e {
  vertical-align: super;
}  
0

New to Communities?

Join the community