CodePen

HTML

            
              <div id="i1" style="height:'20px';width:20px;background-color:red;">hey</div>


<div id="out"></div>
            
          
!

↑ Insert the most common viewport meta tag

CSS

            
              
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              

$.fn.setFixedStyle = function(styles){
  var s = $(this).attr("style");
s = "{"+s.replace(/;/g,",").replace(/'|"/g,"");
s = s.substring(0,s.length-1)+"}";
s = s.replace(/,/g,"\",\"").replace(/{/g,"{\"").replace(/}/g,"\"}").replace(/:/g,"\":\"");
var stOb = JSON.parse(s);
  var st;
  if(!styles){
    $.each(stOb,function(k,v){
      stOb[k] +=" !important";
    });
  }
  else{
  $.each(styles,function(k,v){
    if(v.length>0){
        stOb[k] = v+" !important";
      }else{
        stOb[k] += " !important";  
      }
  });
  }

var ns = JSON.stringify(stOb);
  $(this).attr("style",ns.replace(/"|{|}/g,"").replace(/,/g,";")); 
$("#out").append($(this).attr("style"));
};

$("#i1").setFixedStyle({"width":"50px","height":""});

            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................