Posts Tagged “CSS”

Simple IE Detection and CSS Selector Injection into HTML Tag

Posted on March 23rd, 2016 by webninjataylor

// IE Detection (for alternative since icon font is being blocked) if((navigator.appVersion.indexOf(‘MSIE’)!== -1)||(navigator.appVersion.indexOf(‘Windows’)!== -1)){ rm.isIE = true; $(‘html’).addClass(‘ie’); }

Sizing Inline SVG

Posted on August 16th, 2015 by webninjataylor

The best way I found to size inline SVG graphics: Trim artboard to artwork bounds in Illustrator (Object > Artboards > Fit to Artwork Bounds) Save as SVG and then open it in a text editor Leave the viewBox dimensions exactly as they are Calculate the % difference between width and height in the viewBox values […]

Arrow Tabs with CSS

Posted on July 15th, 2015 by webninjataylor

JS Bin on jsbin.com Resources CSS Arrow Please

Tags:
Posted in Web ShotsComments Off on Arrow Tabs with CSS

CSS Calculations

Posted on July 15th, 2015 by webninjataylor

You can calculate properties in CSS with calc()… height: calc(100vh – 313px); vh and vw are the new CSS3 viewport units.

Tags:
Posted in Web ShotsComments Off on CSS Calculations

Chrome Extensions

Posted on April 22nd, 2015 by webninjataylor

Chrome extension is just some HTML, CSS and JavaScript that allows you to add some functionality to Chrome through some of the JavaScript APIs Chrome exposes. An extension is basically just a web page that is hosted within Chrome and can access some additional APIs Browser Action extension is a basic Chrome extension manifest.json … […]

CSS Responsive Columns

Posted on August 13th, 2014 by webninjataylor

<style> .myColumns { column-count: 2; -webkit-column-count: 2; -moz-column-count: 2; column-width: 250px; /* MINIMUM WIDTH */ -webkit-column-width: 250px; -moz-column-width: 250px; /* …or use COLUMNS shorthand… */ columns: 4 250px; -webkit-columns: 4 250px; -moz-columns: 4 250px; column-gap: 4em; /* Default is 1em */ -webkit-column-gap: 4em; -moz-column-gap: 4em; column-rule: 1px dotted #ddd; -webkit-column-rule: 1px dotted #ddd; -moz-column-rule: 1px […]

Designing for Mobile Resolutions

Posted on July 1st, 2014 by webninjataylor

dp (Density Independent Pixels): is a measure of screen size dpi (Dots per Inch): is a measure of screen density iOS non-Retina to Retina display transition (163ppi to 326ppi) Size buckets are phone (smaller than 600dp) and tablet (larger than or equal 600dp) Density buckets for Android are LDPI, MDPI, HDPI, XHDPI, XXHDPI, and XXXHDPI ldpi: Resources for low-density […]

CSS3 Animation with transform: scale(n, n);

Posted on June 25th, 2014 by webninjataylor

<div class=”animateable”></div> /******** SCALE ********/ .animateable { … animation: inout 2s; -webkit-animation: inout 2s; animation-iteration-count: 1; -webkit-animation-iteration-count: 1; } @keyframes inout { 0% { transform: scale(0, 0); } 50% { transform: scale(2, 2); } 100% { transform: scale(1, 1); } } @-webkit-keyframes inout { /* Safari & Chrome */ 0% { -webkit-transform: scale(0, 0); } […]

Tags:
Posted in Web ShotsComments Off on CSS3 Animation with transform: scale(n, n);

Video as Page Background

Posted on June 25th, 2014 by webninjataylor

<div id=”bigvid”> <video id=”big-video-vid_html5_api” class=”vjs-tech” preload=”auto” data-setup=”{}” webkit-playsinline=”” autoplay=”autoplay” src=”http://barrelny.com/recap/2012/wp-content/themes/barrel-portfolio/im/office_small.mp4″ loop></video> </div> #bigvid { position: absolute; background-color: #000; height: 100%; width: 100%; }

Tags: ,
Posted in Web ShotsComments Off on Video as Page Background

CSS3 Text and Motion Experiment

Posted on June 25th, 2014 by webninjataylor

Animating with CSS can be as simple as using transform and/or transition on elements and setting the final animation state via a pseudo-class like :hover… … #text { … top:200px; … opacity: 0; -webkit-transition: all 2s linear; -moz-transition: all 2s linear; } #photo { opacity: 0.25; -webkit-transform: scale(1.5) translate3D(0, 0, 0); -webkit-transition: all 5s linear; […]

Tags:
Posted in Web ShotsComments Off on CSS3 Text and Motion Experiment

Embed a Fiddle

Posted on June 25th, 2014 by webninjataylor

<iframe src=”http://jsfiddle.net/USERNAME/FIDDLE/embedded/result,resources,html,css,js” width=”100%” height=”300″ frameborder=”0″ allowfullscreen=”allowfullscreen”></iframe>

The Proper Way to Add CSS and JS to a WordPress Theme

Posted on June 23rd, 2014 by webninjataylor

Add this to functions.php for JS and CSS.  Check out the WordPress Codex for available parameters and info on using the ‘$’ namespace for jQuery. <?php function wnt_styles(){ // STYLES wp_register_style(‘bootstrapcss’, get_template_directory_uri() . ‘/css/bootstrap.css’, array(), ‘20140529’, ‘all’ ); wp_enqueue_style(‘bootstrapcss’); } add_action(‘wp_enqueue_scripts’, ‘wnt_styles’); wp_enqueue_script(‘jquery’); // This is all that’s needed for jQuery since WordPress already has […]

Smooth, Elastic Scrolling on Mobile

Posted on June 13th, 2014 by webninjataylor

Add this for smooth, elastic scrolling on mobile… #s4-workspace { -webkit-overflow-scrolling: touch; }

Tags: ,
Posted in Web ShotsComments Off on Smooth, Elastic Scrolling on Mobile

Adaptive vs. Responsive

Posted on June 3rd, 2014 by webninjataylor

Web developers have their panties all up in a twist over this issue.  Here is the boiled-down comparison… Responsive: The distilled definition of a responsive web design is that it will fluidly change and respond to fit any screen or device size. Coined several years ago by Ethan Marcotte and first introduced in his A List Apart article, […]

508: Hidden Supporting Text

Posted on November 13th, 2013 by webninjataylor

The standard is to use this CSS… .hidden { height: 1px; left: -10000px; overflow: hidden; position: absolute; top: auto; width: 1px; }