/* Styles for the popup window and overlay */ .popup { display: none; /* Hidden by default */ position: fixed; z-index: 1; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgb(0,0,0); background-color: rgba(0,0,0,0.4); padding-top: 14%; } .popup-content { background-color: #fefefe; margin: 5% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 600px; } .close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; } .close-btn:hover, .close-btn:focus { color: black; text-decoration: none; cursor: pointer; } Water-repellent technology, structured, mid-profile, six-panel, sewn eyelets, Permacurv visor. Poly/Nylon/Cotton/Spandex blend. DXDT embroidered logo on the front, Corvette Crossed Flags on back. Size Chart × HOW TO MEASURE CAPS Measure the circumference around the head, above the eyebrow and at the widest part of the head. Divide that number by 3.14 for cap size. Hat Size S/M L/XL Head (in) 6.75-7.25 7.13-7.63 // Get the popup var popup = document.getElementById("popup"); // Get the button that opens the popup var btn = document.getElementById("popupBtn"); // Get the element that closes the popup var span = document.getElementsByClassName("close-btn")[0]; // When the user clicks the button, open the popup btn.onclick = function() { popup.style.display = "block"; } // When the user clicks on (x), close the popup span.onclick = function() { popup.style.display = "none"; } // When the user clicks anywhere outside of the popup, close it window.onclick = function(event) { if (event.target == popup) { popup.style.display = "none"; } }