Is creating a CSS button as a link using ‘a href’ a safe practice?
-
<a href="https://www.google.com/" target="_blank" rel="noopener"><button class="button">Click to DOWNLOAD</button></a>
OR
<a href="https://www.google.com/" target="_blank" rel="noopener" class="button">Click to DOWNLOAD</a>
CSS: .button { background-color: #4CAF50; /* Green */ border: none; color: white; padding: 16px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; transition-duration: 0.4s; cursor: pointer; }
HTML:
<a href="https://www.google.com/" target="_blank" rel="noopener"><button class="button">Click to DOWNLOAD</button></a> OR <a href="https://www.google.com/" target="_blank" rel="noopener" class="button">Click to DOWNLOAD</a>
I checked this and both working fine in wordpress. Is this valid/safe? Also, which one I should use? More optimal?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Is creating a CSS button as a link using ‘a href’ a safe practice?’ is closed to new replies.