Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

วิธีสร้าง Loading Buttons ด้วย CSS


โค้ดต่อไปนี้เป็นการสร้าง Loading Buttons ด้วย CSS

ตัวอย่าง

<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> button {    background-color: rgb(60, 24, 126);    border: none;    outline: none;    color: white;    padding: 12px 24px;    font-size: 26px; } h1{    font-size: 50px;    font-family: monospace,sans-serif,serif; } i {    margin-left: -12px;    margin-right: 8px; } </style> </head> <body> <h1>Loading Buttons Example</h1> <button><i class="fa fa-spinner fa-spin"></i>Loading</button> <button><i class="fa fa-circle-o-notch fa-spin"></i>Loading</button> <button><i class="fa fa-refresh fa-spin"></i>Loading</button> </body> </html>

ผลลัพธ์

โค้ดข้างต้นจะสร้างผลลัพธ์ดังนี้

วิธีสร้าง Loading Buttons ด้วย CSS