I can\'t seem to get the drop down items to not go off the page. I tried a couple of things from BS3 but they don\'t seem to work. I\'m not sure if its because of the
I was looking over your code and I think the accepted answer addresses a different problem. If the menu move to the left or the right of the page and is not under the button, it is because you are missing the parent class .btn-group and it seems like your .dropdown-toggle and .dropdown-menu classes are on the wrong elements. Here is the most basic example from the Bootstrap 4 docs.
I only went over a small block of your code, but at the end where you have a dropdown on large screens, I focused on this.
to