The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

335036 (1) [Avatar] Offline
#1
In listing 7.6 the dropdown menu is absolutely positioning below the label using the following ruleset:
.dropdown-menu {
display: none;
position: absolute;
left: 0;
top: 2.1em;
min-width: 100%;
background-color: #eee;
}

Using top: 2.1em relays over the size of the dropdown label and the padding around it (.5em top and bottom).
Generally I think that using top: calc(100% + .1em) is a more solid approach as it allows to change the padding / font size freely