Output Buffering

<?php
 
  // Start buffering
  ob_start();

  // Output stuff (probably not this simple, might be custom CMS functions...
  echo 'Print to the screen!!!';

  // Get value of buffering so far
  $getContent = ob_get_contents();

  // Stop buffering
  ob_end_clean();

  // Do stuff to 
Avatar of Chris Coyier
Chris Coyier on

Different Transitions for Hover On / Hover Off

In other words, “Different transitions on mouseenter and mouseleave” as those are the DOM events that happen, but we’re not using JavaScript here, we’re talking about CSS :hover state and CSS3 transitions. Hover on, some CSS property animates itself …

Avatar of Chris Coyier
Chris Coyier on

HTML5 Article Structure with hNews

The spec for hNews.

<article class="hentry">
  <header>
    <h1 class="entry-title">But Will It Make You Happy?</h1>
    <time class="updated" datetime="2010-08-07 11:11:03-0400" pubdate>08-07-2010</time>
    <p class="byline author vcard">
        By <span class="fn">Stephanie Rosenbloom</span>
    </p>
  </header>

  <div class="entry-content">
      <p>...article text...</p>
      <p>...article text...</p>
   
      <figure>
        <img src="tammy-strobel.jpg" alt="Portrait of 
Avatar of Chris Coyier
Chris Coyier on (Updated on )

Lessons with Media Queries

Direct Link

Sam Collins with a big writeup on his experience using media queries and comparing them against other mobile optimization techniques. There are lots of good practical tips to use inside your media queries like:

  • Remove all CSS and JavaScript animations
Avatar of Chris Coyier
Shared by Chris Coyier on

Implied Block

Jeff Starr tweeted a simple tip the other day:

If you’re floating an inline element, it’s treated as block, so no need to include “display: block;” in your stylesheet.

Indeed that is exactly what happens. The spec:

The values

Avatar of Chris Coyier
Chris Coyier on

Equal Height Blocks in Rows

A jQuery based solution for equalizing the heights of boxes across the horizontal row they are in. Different rows can have different heights. Originally by Stephen Akins.
Avatar of Chris Coyier
Chris Coyier on (Updated on )

Ajax Load Container Contents

Use jQuery to replace a section of the page with that same section of the page from a different URL. The trick is to grab the contents of the section, not the section itself.
Avatar of Chris Coyier
Chris Coyier on