게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
css 질문드립니다!!
게시물ID : programmer_19055짧은주소 복사하기
작성자 : 귀두
추천 : 0
조회수 : 356회
댓글수 : 2개
등록시간 : 2016/11/21 03:03:02
옵션
  • 본인삭제금지
제가 지금 체크박스를 꾸미고 싶은데요...

.checks input[type="checkbox"] {  /* 실제 체크박스는 화면에서 숨김 */
  position: absolute;
   width: 1px;
   height: 1px;
   padding: 0;
   margin: -1px;
   overflow: hidden;
   clip:rect(0,0,0,0);
   border: 0
}
.checks input[type="checkbox"] + label {
  display: inline-block;
  position: relative;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.checks input[type="checkbox"] + label:before {  /* 가짜 체크박스 */
  content: ' ';
  display: inline-block;
  width: 21px;  /* 체크박스의 너비를 지정 */
  height: 21px;  /* 체크박스의 높이를 지정 */
  line-height: 21px; /* 세로정렬을 위해 높이값과 일치 */
  margin: -2px 8px 0 0;
  text-align: center; 
  vertical-align: middle;
  background: red;
  border-radius : 3px;
  box-shadow: 0px 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05);
}

.checks input[type="checkbox"] + label:active:before,
.checks input[type="checkbox"]:checked + label:active:before {
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px 1px 3px rgba(0,0,0,0.1);
}

.checks input[type="checkbox"]:checked + label:before {  /* 체크박스를 체크했을때 */ 
  content: '\2714';  /* 체크표시 유니코드 사용 */
  color: black;
  text-shadow: 1px 1px #fff;
  background: red;
  border-color: black;
  box-shadow: 0px 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05), inset 15px 10px -12px rgba(255,255,255,0.1);
}

이런식으로 css가 되어있고

<input type="checkbox" id="ex_chk" name="objChkBox" onClick="chkBoxCheck(0)"> 
<label for="ex_chk" >1</label>

<input type="checkbox" id="ex_chk2" name="objChkBox" onClick="chkBoxCheck(1)">
<label for="ex_chk2">2</label>

이런식으로 input 태그가 되어있는데
저css에 background 를 바꾸면 둘다 바뀌는데 하나하나 따로바꾸고 싶을땐 어떻게 해야할까요??
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호