css - "vertical-align:middle" does not work when apply the container element "float" -


this question has answer here:

the following code works well:

<div id="container">    <p>test</p> </div>  #container{height:500px;display:table-cell;vertical-align:middle;} 

but when containerelement has css property:float:left

it cannot work!!

i want vertical-middle while floating

you must set line-height in case:

line-height:500px


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -