Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Adjust the layout of an HTML element based on its width

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 tools
Octocat-spinner-32 demo.html Added fixes for compiled versions. January 25, 2012
Octocat-spinner-32 readme.md
Octocat-spinner-32 responsive-containers.min.js
readme.md

Selector queries and responsive containers

This script allows you to apply different class values to an HTML element based on its width. Use it as follows:

<div data-squery="min-width:400px=wide max-width:10em=small">
    <p>Content here</p>
</div>

This will apply a class of wide when the element is wider than 400 pixels and a class of small when it is narrower than 10 ems. It works in all modern browsers back to and including IE6.

That's all.

Something went wrong with that request. Please try again.