Add line height to body

Comment icon Small gray icon for comments Comments

If you’ve been adding line height to each textual element separately, e.g., <h*>, <p>, etc., this is a helpful tip that you’ll want to try: add line height to the body selector instead. body { line-height: 1.5; } Now all textual elements will have a consistent line height that is...


Zero-based date, Christmas, and emoji

Comment icon Small gray icon for comments Comments

Here’s a quick tip if you’re starting out with JavaScript: which of the following values passed to the getMonth() and getDate() methods will print December 25? 11,24 11,25 12,25 If you answered 11,25, have some egg nog and an extra piece of ribbon candy, you’re doing awesome. Zero-based counting JavaScript...


Responsive video resizing

Comment icon Small gray icon for comments Comments

There are a number of options for implementing responsive images, e.g., the <picture> element, client-side polyfills, automatic cropping, et al. But what about video? Many of the examples I see in responsive layouts replace video with a static image in smaller viewports. That may be because of concerns regarding data...