Have you tried just putting the code into an HTML file, AND a CSS file (with a link in the head tag) to see if it worked not on CodePen? I sometimes find bugs in CodePen where something doesn't work there, but works fine in all the browsers.
Especially Bootstrap stuff!!!
Let me know if you have can't get aren't familiar with how to make the code it's own HTML file, and I'll take the code and run the browser test myself. Like I siad CodePen isn't perfect.