Issue
How can I align Logout
and logout.svg
in one line so that when you hover over it it gets displayed correctly?
.dropdown {
position: absolute;
min-width: 150px;
background-color: yellow;
}
#row {
display: flex;
}
#logout {
height: 25px;
}
#element {
display: block;
padding: 14px;
border-bottom: 1px solid #caced1;
}
#element:hover {
background-color: white;
}
<div class="dropdown">
<div id="row">
<img id="logout" src="https://www.svgrepo.com/show/135250/logout.svg">
<span id="element">Logout</span>
</div>
</div>
I tried to position the icon as absolute and add margin to it but it didn't worked.
Solution
Just use align-items: center;
.dropdown {
position: absolute;
min-width: 150px;
background-color: yellow;
}
#row {
display: flex;
align-items: center;
}
#logout {
height: 25px;
}
#element {
display: block;
padding: 14px;
border-bottom: 1px solid #caced1;
}
#element:hover {
background-color: white;
}
<div class="dropdown">
<div id="row">
<img id="logout" src="https://www.svgrepo.com/show/135250/logout.svg">
<span id="element">Logout</span>
</div>
</div>
Answered By - Paulie_D
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.