The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › mobile icon not positioning properly
Posted this pen yesterday. Trying to get the responsive mobile icon to stay in the same position when clicked. Thought it was fixed, but gets messed up if the body margin or padding is used.
https://codepen.io/derek-deboer/pen/XGONqB
.subnav .icon { display: none; position: absolute; right: 0; top: 0; }
Apparently I’m over my head with this.
I think you forgot to use a positioning context. Add position:relative to the parent container
position:relative
https://codepen.io/Paulie-D/pen/EMMrPv