Centralize content in a CSS border

Asked

Viewed 739 times

0

I would like the Between/Register be centered vertically inside the edges, but I’m not able to do that.

Follow the code below:

inserir a descrição da imagem aqui

HTML:

<ul class="menu_2">    
    <div class="user"><li><i class="fa fa-user"></i> Entre/Cadastre-se<i class="fa fa-angle-down"></i></li></div> 
</ul>

CSS:

.menu_2{
    padding: 10px;
    font-size: 10pt;  
    margin-top: 20px;
    color: #6495ED;
}

.user{
    margin-right: 30px;
    font-size: 12pt;
    border: 1px solid;
    float: left;
    height: 49px;
}

1 answer

1


use line-height about the same height as elemento

ul {
list-style: none;
}

.menu_2{
padding: 10px;
font-size: 10pt;  
margin-top: 20px;
color: #6495ED;
}

.user{
margin-right: 30px;
font-size: 12pt;
border: 1px solid;
float: left;
height: 49px;
line-height: 49px;
}
<link href="https://opensource.keycdn.com/fontawesome/4.7.0/font-awesome.min.css" rel="stylesheet"/>

<ul class="menu_2">    
<div class="user"><li><i class="fa fa-user"></i> Entre/Cadastre-se<i class="fa fa-angle-down"></i></li></div> 
</ul>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.