2014-11-06 2 views

답변

4

$('.jspPane').css("padding","1px 0 0 0"); 
.

이 경우에는 패딩으로 변경하려고합니다. 당신은 스타일에서 변경할CSS 속성, 그리고 직접 문자열을 작성하는 데 필요한 .css() 방법에서

$('.jspPane').css({ padding: 1, top: 1 }); // or { padding: "1px", top: "1px" } 

.


이 메서드를 사용하면 속성 이름을 전달할 수있는 방법이 늘어납니다.

하나의 방법은 같은 방법으로 연결 속성을 허용하지 않습니다. 대신 당신이 체인의 특성에 할 수 있습니다 개체를 전달하여 다른 한편으로 방법

$(selector).css('propertyName', 'string or integer to write in property') 
      .css('propertyName', 'string or integer to write in property'); 

체인에 필요

$(selector).css({ 
    propertyName: 'string or integer to write in property', 
    propertyName2: 'string or integer to write in property' 
}); 

은 또는 당신은 단지 스타일의 속성을 편집 할 수

$('.jspPane').attr('style', "padding: 1px; top: 1px;"); 
1

당신은 올바른 구문은이 incorrectly.The을하고있다 (상단에서 패딩을 적용하기 위해)

당신이 "padding: 0px; top: -737px;" 들어있는 스타일 속성이 표시되는 내용

Example to change css

관련 문제