<h1>CSS Attribute HREF with Pseudo-elements</h1>
<h2>a[href$=".pdf"]::after</h2>
<p>Use a[href$=".pdf"]::after to add (PDF) to links that end in .pdf</p>
<p>An example of a <a href="#" target="_blank">hyperlink</a> to #.</p>
<p>An example of a hyperlinked PDF file: <a href="https://designertofullstack.com/pdf/course-offerings.pdf" target="_blank">course offerings<a/>. Note: the CSS adds parenthesis and the letters PDF programmatically.</p>
/* Add (PDF) after all links that end with .pdf */
a[href$=".pdf"]::after { 
  content: " (PDF)"; 
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.