Input radio custom

miin·2023년 8월 14일
0

HTML / CSS

목록 보기
28/28
post-thumbnail

Input radio 커스텀 하기

  • appearance: none; 로 기본 스타일을 없애는게 중요
return(
  <div>
  	<Radio type='radio' id={list.name}/>
  	<label>{list.text}</label>
  <div>
  )
  
  
const Radio = styled.input`
  width: 20px;
  height: 20px;
  margin-right: 8px;
  color: 'blue';
  border: 3px solid blue;
  border-radius: 50%;
  appearance: none; 
  -webkit-appearance: none;
  &:checked {
    border: 9px solid #0066fe;
}
`

1개의 댓글

comment-user-thumbnail
2023년 8월 14일

개발자로서 성장하는 데 큰 도움이 된 글이었습니다. 감사합니다.

답글 달기