Question about CSS code:
.dropdown-menu {
position:absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 6px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.arrow {
position:absolute;
margin-bottom: 50px;
margin-left: 50px;
width: 0;
height: 0;
border-style: solid;
border-width: 0 5px 8.7px 5px;
border-color: transparent transparent #007bff transparent;
line-height: 0px;
_border-color: #000000 #000000 #007bff #000000;
_filter: progid:DXImageTransform.Microsoft.Chroma(color='#000000');
}
HTML code:
<ul class="dropdown-menu">
<li class="arrow"></li>
<li><a href="#">Credit History</a></li>
<li><a href="#">Purchased Content</a></li>
<li><a href="#">Access logs</a></li>
</ul>
`
The margin-bottom: 50px;
from the arrow
class is meant to move the arrow down. However, what if we try margin-top: 50px;
? It seems that even with this change, the arrow still moves down instead of up. Is there a reason for this behavior? Any insights would be greatly appreciated!
Later edit: I updated the question.
FIDDLE here