Example | Classification | Explanation |
---|---|---|
a[href*="login"] | Attribute Contains Selector | Selects an element if the given attribute value contains at least once instance of the value stated |
a[href^="https://"] | Attribute Begins With Selector | Selects an element if the given attribute value begins with the value stated |
a[href$=".pdf"] | Attribute Ends With Selector | Selects an element if the given attribute value ends with the value stated |
a[rel~="tag"] | Attribute Spaced Selector | Selects an element if the given attribute value is whitespace-separated with one word being exactly as stated |
a[lang|="en"] | Attribute Hyphenated Selector | Selects an element if the given attribute value is hyphen-separated and begins with the word stated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a slightly modified technique of the one found on: | |
// https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php | |
(function ($) { | |
'use strict'; | |
let $container = $('.js-responsive-iframes-container'); | |
let $containerIframes = $container.find('iframe'); | |
// Figure out and save aspect ratio for each iframe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Smooth scrolling to anchors | |
// | |
// This is a slightly modified version of the script provided by CSS Tricks | |
// https://css-tricks.com/snippets/jquery/smooth-scrolling/ | |
(function ($) { | |
// Select all links with hashes | |
$('a[href*="#"]') | |
// Remove links that don't actually link to anything | |
.not('[href="#"]') |