Ask A Question


You’re not receiving notifications from this thread.

How do I exclude images in my auto formatting of PDF links?

AustinLan asked in CSS

I added some CSS to my site to put a font a wesome PDF icon in front of every hyperlink that links to a PDF. It looks great, but there are a lot of instances where there are thumbnails images that also link to a PDF and it looks dumb having the icon in front of the image. Is there something I can add to my CSS to exclude images that are hyperlinked, or CSS that I could add as a class to hyperlinked images to not have the icon?

Here is the CSS I used. The not(img) obviously didn't work.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 78,890+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.