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

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -