 <p>if i got you right...</p> <p>JQuery:</p> <pre><code>$(document).ready(function(){ var ParentWidth = $('.parent').width(); if (ParentWidth &gt; 400) { $('.parent').addClass('newstyle'); } }); </code></pre> <p>CSS:</p> <pre><code>.newstyle { background: red; /*** add more css ***/ } </code></pre> <p>i Recommends you to use class because you can add more css to the class later.</p>