• 회원가입
  • 로그인
  • 구글아이디로 로그인

[DOM_Style] JS - borderImage 속성 - 테두리이미지 설정/반환 (= borderImage속성 = 보더이미지속성, IE11)

목차

  1. borderImage 예제 - 테두리 이미지 설정
  2. borderImage 정의
  3. borderImage 구문

 

borderImage 예제 - 테두리 이미지 설정 

 

<style> 

#hz {

  border: 15px solid transparent;

  width: 250px;

  padding: 10px 20px;

  -webkit-border-image: url(https://homzzang.com/img/css/border.png) 30 30 stretch; /* Safari 5 */

  -o-border-image: url(https://homzzang.com/img/css/border.png) 30 30 stretch; /* Opera 12 */

  border-image: url(https://homzzang.com/img/css/border.png) 30 30 stretch;

}

</style>


<button onclick="homzzang()">클릭</button>


<div id="hz">

<h1>홈짱닷컴 Homzzang.com</h1>

</div>


<script>

function homzzang() {

  document.getElementById("hz").style.WebkitBorderImage = "url(https://homzzang.com/img/css/border.png) 30 30 round";  /* Safari 5 */

  document.getElementById("hz").style.OBorderImage = "url(https://homzzang.com/img/css/border.png) 30 30 round";  /* Opera 12 */

  document.getElementById("hz").style.borderImage = "url(https://homzzang.com/img/css/border.png) 30 30 round";

}

</script>


결과보기

 

borderImage 정의

 

테두리 이미지 단축속성. (아래 속성들을 한번에 정의 가능.)

 


 

1.

생략된 값은 해당 속성의 기본값으로 설정.

 

2.

  • 기본값: none 100% 1 0 stretch
  • 반환값: 요소의 CSS border-image 속성값 표시 문자열
  • CSS버전: CSS3


3.

IE11 이상 주요 최신브라우저 지원. 

 

 

borderImage 구문

 

[반환]

object.style.borderImage 

 

[설정]

object.style.borderImage = "source slice width outset repeat|initial|inherit"

 


[속성값]

 

borderImageSource

테두리 이미지 경로

 

borderImageSlice

테두리 이미지 안쪽 오프셋

 

borderImageWidth

테두리 이미지 너비

 

borderImageOutset

테두리 이미지 영역이 테두리 상자 넘는 확장 양

 

borderImageRepeat

테두리 이미지를 반복/둥글게/늘리기 등 지정

 

initial

이 속성의 기본값으로 설정.

 

inherit

부모 요소의 속성값 상속. 

 



분류 제목
HTML_Objects JS - <iframe> 객체 ★ - 타웹페이지삽입 (= iframe태그 = 아이프레임태그)
HTML_Objects JS - <img> 객체 ★ - 사진/그림/이미지 (= img태그 = 이미지태그)
HTML_Objects JS - <ins> 객체 - 텍스트삽입표시 (= ins태그 = 인스태그 = 인서트태그)
HTML_Objects JS - <input type="button"> 객체 - button타입 input태그 (= 인풋버튼태그)
HTML_Objects JS - <input type="checkbox"> 객체 ★ - checkbox타입 input태그 (= 인풋…
HTML_Objects JS - <input type="color"> 객체 - color타입 input태그 (= 인풋컬러태그) ※ …
HTML_Objects JS - <input type="date"> 객체 - date타입 input태그 (= 인풋데이트태그) ※ 날…
HTML_Objects JS - <input type="datetime"> 객체 - datetime타입 input태그 (= 인풋데이…
HTML_Objects JS - <input type="datetime-local"> 객체 - datetime-local타입 inp…
HTML_Objects JS - <input type="email"> 객체 - email타입 input태그 (= 인풋이메일태그)
HTML_Objects JS - <input type="file"> 객체 ★ - file타입 input태그 (= 인풋파일태그) ※ …
HTML_Objects JS - <input type="hidden"> 객체 ★ - hidden타입 input태그 (= 인풋히든태그…
HTML_Objects JS - <input type="image"> 객체 ★ - image타입 input태그 (= 인풋이미지태그)…
HTML_Objects JS - <input type="month"> 객체 - month타입 input태그 (= 인풋먼스태그) ※ …
HTML_Objects JS - <input type="number"> 객체 - number타입 input태그 (= 인풋넘버태그) …
HTML_Objects JS - <input type="password"> 객체 - password타입 input태그 (= 인풋패스…
HTML_Objects JS - <input type="radio"> 객체 ★ - radio타입 input태그 (= 인풋라디오태그 …
HTML_Objects JS - <input type="range"> 객체 - range타입 input태그 (= 인풋레인지태그) ※…
HTML_Objects JS - <input type="reset"> 객체 - reset타입 input태그 (= 인풋리셋태그) ※ …
HTML_Objects JS - <input type="search"> 객체 - search타입 input태그 (= 인풋서치태그) …
57/67
목록
찾아주셔서 감사합니다. Since 2012