Category: Code Snippets
All code snippets related to UI development or Front-end Development. It is the parent category to other code categories.
Replace all images with .svg extension with SVG code and retain image’s classes
Here is a jQuery code snippet that will replace all your images with the SVG codes and retain all classes that images have, getting added to the SVG class attribute. // Replace image tag with svg const replaceWithSVG = () => { let imgSelector =...Replace an SVG image by SVG code – Script
Here is a script that will help you replace an image tag with an SVG extension image file with SVG code. This can be helpful when you don’t want too much SVG code inside your HTML file. (function () {...CSS zebra stripe logic for more than two colors
Zebra stripes are a popular design element that can be used to add visual interest and organization to tables and other elements. By default, zebra stripes are created using alternating colors of white and light gray. However, with CSS, it’s possible to create...CSS technique for elastic moving active background for navigations
Here is a simple CSS solution (javascript not needed here) to achieve the active state elastic animations that go from left to right during the active state of a particular nav tab. Let “.bg-elastic” is the free-moving active state element inside the nav...