Html
<nav class="dropdown">
<a href="#css">CSS</a>
<section class="drop-right align-middle">
<a href="#grid">grid</a>
<a href="#typography">typography</a>
<a href="#code">code</a>
<a href="#tables">tables</a>
<a href="#forms">forms</a>
<a href="#buttons">buttons</a>
<a href="#images">images</a>
</section>
</nav>
Less
&.dropdown {
position: relative;
> section {
position: absolute;
display: none;
min-width: 14rem;
background: @matteBlack;
&.drop-right {
left: 100%;
top: 0;
&.align-middle {
margin-top: -50%;
}
}
.clear();
}
&:hover {
> section {
display: block;
}
}
}
.clear() {
&:after {
content: "";
display: table;
clear: both;
}
}
I'm trying to get a middle aligned drop right but the margin-top isn't working as expected. I expect the margin-top to be half its height. But no matter what any other value is (I have changed the left and height), margin-top remains as -109.75px. Here is an example of the computed values.