<div class="wrapper">
<h2>Custom Link Styles Based on File Type</h2>
<a href="file.pdf">Document name (pdf)</a><br />
<a href="file.zip">File name (zip)</a><br />
<a href="mailto:noreply@gmail.com">noreply@gmail.com</a>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #f1f4f7;
color: #3b495e;
font-family: Inter;
font-size: 1rem;
line-height: 1.5;
}
.wrapper {
width: 100%;
max-width: 1200px;
margin: 50px auto;
padding: 0 30px;
text-align: center;
}
h2 {
margin-bottom: 20px;
}
a {
color: #46a787;
font-weight: 500;
text-decoration: none;
}
a:hover {
color: #3c9376;
text-decoration: underline;
}
/* ---------------------------------------------------- */
/* Snippflow Custom Link Styles Based on File Type */
/* ---------------------------------------------------- */
a[href]::before {
font-family: "Font Awesome 6 Free";
osx-font-smoothing:grayscale;
font-smoothing:antialiased;
display:inline-block;
font-style:normal;
font-variant:normal;
line-height:1;
text-rendering:auto;
margin-right: 5px;
min-width: 20px;
text-align: center;
}
/* Style for links to PDF files */
a[href$=".pdf"]::before {
content: "\f1c1";
}
/* Style for links to ZIP files */
a[href$=".zip"]::before {
content: "\f1c6";
}
/* Style for e-mails */
a[href^="mailto"]::before {
content: "\f0e0";
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.