아래 내용을 참고해보자.

http://earthcode.com/blog/2006/01/css_floats_programmatically.html

 

요약하면,

IE에서는 styleFloat, 나머지 cssFloat 를 설정해야 한다.

float로 쓸 수 없는 이유는 예약어와 겹치기 때문이다.

 

Programmatically setting the "float" CSS property in Javascript

IE and Firefox have different ways of doing this, and neither one is what you would expect.

 

In IE, it's myDiv.style.styleFloat="left";

In Firefox, it's myDiv.style.cssFloat="left";

 

Here's a full code block, with primitive browser detection included. This will work in both IE and Firefox:

 

if (document.all) { // very basic browser detection

var sFloat="styleFloat"; //ie

} else {

var sFloat="cssFloat"; //firefox

}

var oMyDiv=document.getElementById("myId");oMyDiv.style[sFloat]="left";

 

http://www.emailonacid.com/blog/details/C13/12_fixes_for_the_image_spacing_in_html_emails

이전 포스트를 통해서 javascript 압축방법을 소개한 적이 있다. CSS도 물론 압축이 가능하다. 다음 링크를 확인해보자. 온라인 상에서 바로 결과를 확인할 수 있다. 압축의 원리는 중복된 스타일을 제거하고 공백등 불필요한 문자열을 제거하는 것이다. 


http://www.csscompressor.com/



또는 javascript 압축 툴로도 사용하고 있는 Yahoo의 YUI Compressor 로도 가능하다.


http://yui.github.com/yuicompressor/


+ Recent posts