Book Formatting

I wanted to format a Field Guide in multiple formats. It was a draft and at the bottom I had a link to subscribe to get the full version when it ships. I wanted to use a button for this on the web but I wanted to list the URL in print formats like PDF and ePub.

Yes, you can use a button in a PDF, if you display it on certain devices. But I wanted it to read like a book and to allow you to open it on your phone if you wanted. I could also add a qrcode for readers. But I don’t think that makes sense for the html version.

So I created two CSS classes. One called web and one called print.

The print class is hidden by default. This means the web class shows up on the web.

Then I have a media query with the print class in it. That hides the web class and shows the print class.

The result is that the web page shows a button while hitting print shows a printed URL.


JoelDare.com © Dare Companies Dotcom LLC

Terms - Privacy