Latest Tutorials and How-To's

css

How to Position Element to Bottom of Its Container with CSS Flex

A multi-row layout where the last DIV needs to be placed at bottom of its parent container can be created using CSS flex, by setting margin-top as auto for the last element.
May 6, 2020
javascript

Getting Property Value in a Deeply Nested Object (using ES2020 Optional Chaining Operator)

Property value in a deeply nested Javascript object can be found using the Optional Chaining Operator, introduced in ES2020.
May 4, 2020
css

How to Create LEFT-RIGHT Alignment of Containers with CSS Flex

A two-column layout, where the first item is aligned to the left, and the second item is aligned to the extreme right, can be created using justify-content CSS flex property.
April 29, 2020
javascript

Handling Error HTTP Responses in Javascript fetch

Failed HTTP responses can be handled in fetch() by checking whether the returned Promise was rejected due to a network error. Subsequently the Response.ok property needs to be checked for an invalid HTTP status code.
April 27, 2020
css

Creating a Slider / Carousel with CSS Flexbox (with infinite repeating items in loop)

A responsive slider / carousel can be created with CSS flexbox using the order property. Items can be repeated infinitely in a circular loop by changing the order property each time.
April 25, 2020
javascript

Reading a Text File from Server using JavaScript

A text file on a server can be read with Javascript by downloading the file with Fetch / XHR and reading the response as text.
April 22, 2020
css

How to Align Column DIVs as Left-Center-Right with CSS Flex

A three-column layout where items are aligned to left, center and right can be created with CSS flex, and using justify-content property.
April 20, 2020
javascript

Javascript File Uploading with Fetch, Async & Await

Javascript fetch method can be used to upload files to server. fetch is Promise-based, so we can use async / await to write synchronous styled functions.
April 13, 2020
css

Creating a Responsive Logo with CSS min() Function (No Media Query Involved)

A responsive logo can be achieved in a HTML page using the CSS min() function, without involving any media query.
April 5, 2020
javascript

Checking If CSS Property Supported in Current Browser with Javascript

With newer CSS properties not available in all browsers, it is sometimes required to check whether a CSS property & its value are supported in the current browser. This can be detected in Javascript using the CSS.supports() method.
March 13, 2020
css

Maintain Image Quality When Applying CSS Transform & Scale

While applying CSS transform on an image, and scaling it, a common problem comes up that the image becomes blurred. This can be largely improved using the CSS image-rendering property.
March 11, 2020
javascript

Get Random Numbers, Cryptographically Secure, in Javascript

Random numbers that are cryptographically strong, can be generated in Javascript using the Web Crypto API.
March 9, 2020
nodejs

Get Date and Time for a Given Timezone in Node.js

The toLocaleString() method of the Date() object can be used to get date and time for a given IANA timezone name in Node.
February 9, 2020
javascript

Using formdata Event for AJAX Form Submissions

The newly introduced formdata event can enable the Javscript FormData object to participate in form submissions. When trying to submit a form via AJAX, this is helpful to include custom elements in the request.
February 3, 2020
nodejs

Base64 Encoding and Decoding in Node.JS

Node.js does not support the standard Javascript methods of atob() and btoa() for base64 conversions. Encoding and decoding base64 data in Node can be done through the inbuilt Buffer module.
February 1, 2020
css

How to Make a DIV 100% of the Window Height using CSS

Making the height of a container element same as that of the window is useful in cases where there is a hero content to be presented. This can be done by setting the CSS height of the element in vh units.
January 30, 2020
php

Download File from AWS S3 Bucket and Save to Local Server using API (PHP)

This article contains sample PHP code that implement the GetObject S3 API call. It will download a file from a S3 bucket, and save it to local server.
January 28, 2020
javascript

Dynamically Rotating an Image using Javascript

An image can be rotated with Javascript by dynamically changing its CSS transform property. The point around which rotation needs to happen can be specified with the transform-origin property.
January 15, 2020
css

How to Create a Black and White Image with CSS

An image can be converted to grayscale or black & white by applying the grayscale CSS filter on it. Even a partial grayscale conversion can be done.
January 13, 2020
javascript

Managing the URL Hash with Javascript

The Javascript URL object can be used to get and set hash value of a given url. To detect a change in hash in the current url, the hashchange event can be listened to.
January 12, 2020