tailwindCSS로 파일 선택부분을 스타일링하고 싶었습니다. 그래서 tailwindCSS file upload Button 이라는 검색어로
입력을 해보니 스택오버플로우에서 다음과 같이 나왔습니다.
How to style HTML file input using Tailwind CSS? - Stack Overflow
How to style HTML file input using Tailwind CSS?
When I encountered this issue it took me about 20 minutes to find the answer in an article here: https://www.kindacode.com/snippet/how-to-style-file-inputs-with-tailwind-css/ I had scrolled though ...
stackoverflow.com
다음과 같이 file이라는 클래스네임을 이용해서 디자인을 입히고 , 추가 효과를 입힌다는 것을 알게 되었습니다.
그래서 저는 다음과 같이 적용하였습니다.
{!selectFile && (
<input
type="file"
accept="image/*"
onChange={onchangeSelectFile}
className="border-2 border-slate-700 shadow-md rounded-md font-bold
<!-- 파일업로드 버튼 배경색, 버튼 클릭시 효과(마우스 커서 변경 , 배경색 변경 -->
file:bg-black file:text-white file:cursor-pointer file:hover:bg-slate-600
"
/>
)}
그리하여 나온 것이 이것입니다. 다음은 결과입니다.
[1] 클릭하기전
[2] 클릭한 후
tailwindCSS로 파일 업로드 버튼을 스타일링할 때는
file 클래스네임을 이용하는 구나....
'프로젝트' 카테고리의 다른 글
wheres-my-toilet 에서 현 위치 기반 가까운 화장실 좌표 표시 및 리스트화 (0) | 2024.05.26 |
---|---|
We_Are_6Jo 프로젝트 하면서 기억에 남는 것들 (0) | 2024.05.17 |
프로젝트3 (0) | 2024.02.26 |
프로젝트 후 느낀 점 , 어려운 점 (0) | 2024.02.15 |
프로젝트2 (0) | 2024.02.08 |