Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add content after text

Is it possible to add text by pseudo-selector ::after or ::before to a specyfic word? For ex. I would like to add pdf icon always next to word "Download". [PDF] Download

Or maybe is it another method?

like image 546
Pat Avatar asked Jun 07 '17 09:06

Pat


1 Answers

your link on pdf need contain pdf, then you could use this selector:

a[href*="pdf"]:before {content: '[ICON] '}
a[href*="pdf"]:after {content: ' 😅';}
<a href="http://example.com/test.pdf" class="pdf">learn html and css in one week</a>
like image 110
kRicha Avatar answered Nov 15 '22 02:11

kRicha