Rounding numbers in Javascript
There are times when we need to round numbers to show on a web page. For example, we might want to round a number to two decimal places when showing currency values. It is tempting just to truncate...
There are times when we need to round numbers to show on a web page. For example, we might want to round a number to two decimal places when showing currency values. It is tempting just to truncate...
I'm not very partial to working with colors in general and with gradients in particular. They used to only be available when working with SVG and not CSS. At some point we gained the ability to work...
Using fonts on the web has a longer story than many would think. The @font-face at-rule has been around since the early days of the web. Initially, there were no fonts on the web... the goal was to...
CSS Fonts Level 4 introduces support for color fonts. The idea is that these fonts will be less resource-intensive because they will make fewer round trips to the server to manipulate the colors...
JSON Schemas allows us to create a schema for JSON data. This would allow us to validate the data and ensure that it is complete and has the correct structure. This would also address one of the...
Part of my love/hate relationship with Rails is that I think it is too opinionated for its own good. It makes it easier for people to write apps if you accept the opinions that DHH and the Rails...
I've always liked shadows as a way to give depth to content that would otherwise be flat and uninspiring. My first approach at creating shadows in CSS was to use box-shadow, primarily in title boxes...
In replaced elements, aspect ratio is the ratio of the width to the height of an image. Until recently we had to rely on the browser's calculations of "implicit" aspect ratios. Over time...
The :any-link styles all a elements with an href attribute. This allows us to target all links in a document, regardless of location or parents. This is particularly useful when playing with...
CSS provides ways to play with the underline of elements beyond removing the underline from links and only showing it on hover. CSS Text Decoration Module Level 4 provides four longhand properties one...