여러분이 사용하고 계신 브라우저는 HTML5를 지원하지 않기 때문에 몇몇 요소가 제대로 보이도록 JScript를 사용하고 있습니다. 하지만 여러분의 브라우저 설정에서 스크립트 기능이 꺼져있으므로, 현재 페이지를 제대로 확인하시려면 스크립트 기능을 켜주셔야 합니다. How To - 로딩 버튼
How To – 로딩 버튼
2개월전 작성
2개월전 수정

w3.css

로딩 버튼

CSS를 사용하여 로딩 버튼을 만드는 방법을 알아보자.

로딩 버튼 스타일 지정 방법

1단계) HTML 추가

Font Awesome과 같은 아이콘 라이브러리를 추가하고 HTML 버튼에 아이콘을 추가한다.

<!-- Add icon library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<!-- Add font awesome icons to buttons (note that the fa-spin class rotates the icon) -->
<button class="buttonload">
  <i class="fa fa-spinner fa-spin"></i>Loading
</button>

<button class="buttonload">
  <i class="fa fa-circle-o-notch fa-spin"></i>Loading
</button>

<button class="buttonload">
  <i class="fa fa-refresh fa-spin"></i>Loading
</button>
2단계) CSS 추가
/* Style buttons */
.buttonload {
  background-color: #04AA6D; /* Green background */
  border: none; /* Remove borders */
  color: white; /* White text */
  padding: 12px 16px; /* Some padding */
  font-size: 16px /* Set a font size */
}
기본 예시
예제 보기
참고
Mingg`s Diary
밍구
공부 목적 블로그