The 'Inside' Problem: How to Break Out and Make An Element Full Width — Let’s say you need a full-width container to get an edge-to-edge background but you want the contents to remain in their usual position. Here are several approaches, each with pros and cons. (We just had to feature this as it’s such a common front-end design problem.)
Chris Coyier
|
Folding the DOM: Using 3D CSS Transforms to 'Fold Up' Images — The ‘trick’ to creating an image folding effect with CSS transforms is to have multiple identical images and then transform them separately. This is a great, interactive tutorial that’s based around React, although the underlying CSS principles are usable anywhere.
Josh W. Comeau
|
Flexible Data Tables with CSS Grid — <table> , originally used for both layouts and tables, became used for tables only (and HTML email!) as CSS became more capable. Well, now, how about skipping <table> even for tabular data? Here’s how to use CSS Grid to make nice tables for tabular data.
Adam Lynch
|
Why and How to Use WebP Images Today — WebP is an image format developed by Google in 2010 as a more efficient alternative to formats like PNG and JPG. As of Firefox 65, Safari is the only major browser to not support it.
Ire Aderinokun
|
supported by
|
|
Making use of the download attribute
The download attribute, when used on an anchor tag, will tell a browser to directly download the linked resource, rather than navigate to it. Here's how to put it into practice:
|
<a href="data_2019.csv" download="2019 Data (CSV)">
Download data
</a>
|
As highlighted above, the download attribute can also be used to change what name is displayed upon downloading — a handy way to display something more readable over possible 'ugly' filenames.
This is just a simple way to handle download links when server-side configuration isn't available for certain file extensions, say. It's worth noting however that you can only use this for same-origin URLs for security reasons.
This week's tip is sponsored by Microsoft Azure. Do you want to use MySQL without worrying about managing, securing, and scaling your database? Learn more about Azure Database for MySQL and get started in minutes.
|
|
|
No comments:
Post a Comment