html - CSS text on the middle of div (div height:20%) -


<style> ._1{   height:20%;   width:100%;   overflow:hidden;   white-space:nowrap;   text-overflow:ellipsis; } </style> <div class="_1">content</div> 

how make content align @ middle of div? thanks. demo

edit: height % not px. set line-height: 20% it's not work.

   div{      height: 20%;     width: 100%;     text-align: center;     display: flex;     flex-direction: column;     flex-wrap: nowrap;     justify-content: space-around;     align-content: center;       }    

Comments

Popular posts from this blog

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -