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

c# SetCompatibleTextRenderingDefault must be called before the first -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -

c++ - Fill runtime data at compile time with templates -