You don’t need jQuery for Selctors

By | How to, Tutourial & Tips

If you want to use the jQuery style to select elements you can add the below code to your project without loading the full jQuery Library. window.$ = function(selector) { var selectorType = ‘querySelectorAll’; if (selector.indexOf(‘#’) === 0) { selectorType = ‘getElementById’; selector = selector.substr(1, selector.length); } return document[selectorType](selector); };…

Read More

YouTube – Responsive video aspect ratio and embedding options

By | Tutourial & Tips

Maintain iFrame video aspect ratio for responsiveness HTML <div class=”aspect-ratio”> <iframe src=”https://www.youtube.com/embed/NV3bPEjNeKU” frameborder=”0″ width=”550″ height=”275″ frameborder=”0″ allowfullscreen></iframe> </div> CSS /* This element defines the size the iframe will take. In this example we want to have a ratio of 25:14 */ .aspect-ratio { position: relative; width: 100%; height: 0; padding-bottom:…

Read More

Linear CSS Gradient Background

By | How to, Tutourial & Tips

CSS: html, body { width: 100%; height: 100%; margin: 0; padding: 0; } body { background: linear-gradient(270deg, #18f0b8, #18a2f0, #db5640); background-size: 600% 600%; -webkit-animation: Gradient 60s ease infinite; -moz-animation: Gradient 60s ease infinite; animation: Gradient 60s ease infinite; } @-webkit-keyframes Gradient { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} } @-moz-keyframes…

Read More