front end hacking

Highlight text on selection in css

Highlight text on selection in cssCreate an awesome effect on selecting text using css.https://codepen.io/JAGATHISH1123/pen/vwdzRmFirst we need to create a para with some text.<p class="highlight-text">Select the text to see magic . </p>Now let’s add a ::selection pseudo selector on an element to style text within it when selected..highlight-text ::selection { background : #738BFA; color : white; }

front end hacking

The Power of Nth Child and All-CSS Dynamic Widths

This should be just a short blog to show you guys something pretty cool that I learned recently.Here goes:On a page there are some buttons.There might be up to three buttons.Style appropriately.Option One: JavascriptSo we count the number of boxes, then add a class such as one-of-three to assign some width-dependent CSS. Something like this:var wrapper = document.getElementById('div.buttonWrap');var count =...