WordPress, by default, will add the width and height attributes to image elements. These attributes will override CSS width and height properties. Making images with these dimension attributes responsive is a bit of a hassle, or in some cases cannot be done at all. Strip Image Dimension Attributes from Inserted Images Stripping out the image … Continue reading Remove Image Size Attributes for Responsive Images in WordPress
Have you ever wanted to have a link to a resource, such as a PDF file, and have that resource be automatically downloaded when the link is clicked? All you need to do is add a download attribute to your link HTML.
But wait, the download attribute isn’t supported across all the current browsers! … Continue reading Automatically Download PDFs via jQuery
<a href="/resources/newsletter.pdf" download>Newsletter</a>
A common practice with web links is to make sure that links to other websites open in a new tab. At the same time, all links to other pages on the same site should open in the current browser tab. It is important to understand why this approach is a best practice. For starters, visitors … Continue reading Open External Links in a New Window
Occasionally, there is a need to create a link that doesn’t actually go anywhere. A great example of this is a top-level menu item that displays a drop-down of sub-menu items. In this use case, you simply want a menu item that serves as a container for other menu items, but isn’t meant to take … Continue reading Disable Links with an Empty href Attribute