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

[DOM_Style] JS - alignSelf 속성(I) - (플렉스아이템 수직정렬. 아이템 자체에 사용. align-self속성. IE11)

목차
  1. alignSelf 예제 - align-self 속성 설정
  2. alignSelf 정의
  3. alignSelf 구문

 

alignSelf 예제 - align-self 속성 설정

 

<style> 

#main {

  width: 250px;

  height: 300px;

  border: 1px solid silver;

  display: -webkit-flex; /* Safari */

  -webkit-align-items: flex-start; /* Safari 7.0+ */

  display: flex;

  align-items: flex-start;

}


#main div {

  -webkit-flex: 1; /* Safari 6.1+ */

  flex: 1;

}


#hz {

  -webkit-align-self: center; /* Safari 7.0+ */

  align-self: center;

}

</style>


<div id="main">

  <div style="background:coral;">HTML</div>

  <div style="background:lightblue;" id="hz">CSS</div>  

  <div style="background:lightgreen;">홈짱닷컴 Homzzang.com</div>

</div>


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


<script>

function homzzang() {

  document.getElementById("hz").style.WebkitAlignSelf = "stretch"; // Safari 7.0+

  document.getElementById("hz").style.alignSelf = "stretch";

}

</script>


결과보기

 

alignSelf 정의

 

CSS align-self 속성 설정/반환.

 

 

alignSelf 구문

 

[반환]

object.style.alignSelf 

 

[설정]

object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"

 


[속성값]

 

CSS align-self 속성 참고.

 

 


분류 제목
DOM_Style JS - borderImage 속성 - 테두리이미지 설정/반환 (= borderImage속성 = 보더이미지속…
DOM_Style JS - borderImageOutset -
DOM_Style JS - borderImageRepeat -
DOM_Style JS - borderImageSlice -
DOM_Style JS - borderImageSource -
DOM_Style JS - borderImageWidth -
DOM_Style JS - borderLeft -
DOM_Style JS - borderLeftColor -
DOM_Style JS - borderLeftStyle -
DOM_Style JS - borderLeftWidth -
DOM_Style JS - borderRadius 속성 ★ - 테두리 둥글게 설정/반환 = 둥근 테두리 = 보더레이디어스 속성…
DOM_Style JS - borderRight -
DOM_Style JS - borderRightColor -
DOM_Style JS - borderRightStyle -
DOM_Style JS - borderRightWidth -
DOM_Style JS - borderSpacing 속성 - 테이블의 셀 간 간격 설정/반환 (= borderSpacing속성…
DOM_Style JS - borderStyle 속성 - 테두리스타일
DOM_Style JS - borderTop 속성 - 테두리상단 (= 상단테두리)
DOM_Style JS - borderTopColor -
DOM_Style JS - borderTopLeftRadius -
44/67
목록
찾아주셔서 감사합니다. Since 2012