Bootstrap 4 บทช่วยสอน

BS4 HOME BS4 เริ่มต้น BS4 คอนเทนเนอร์ BS4 Grid Basic BS4 วิชาการพิมพ์ BS4 สี ตาราง BS4 BS4 รูปภาพ BS4 Jumbotron การแจ้งเตือน BS4 ปุ่ม BS4 กลุ่มปุ่ม BS4 ป้าย BS4 แถบความคืบหน้า BS4 BS4 Spinners BS4 การแบ่งหน้า BS4 รายการกลุ่ม การ์ด BS4 BS4 ดรอปดาวน์ BS4 ยุบ BS4 Navs BS4 Navbar แบบฟอร์ม BS4 อินพุต BS4 กลุ่มอินพุต BS4 BS4 แบบฟอร์มที่กำหนดเอง BS4 ม้าหมุน BS4 โมดอล เคล็ดลับเครื่องมือ BS4 BS4 ป๊อปโอเวอร์ BS4 ขนมปังปิ้ง BS4 Scrollspy BS4 ยูทิลิตี้ BS4 Flex ไอคอน BS4 วัตถุสื่อ BS4 ตัวกรอง BS4

Bootstrap 4 Grid

ระบบกริด BS4 BS4 ซ้อน/แนวนอน BS4 Grid XSmall BS4 กริดขนาดเล็ก BS4 กริดขนาดกลาง BS4 กริดขนาดใหญ่ BS4 Grid XLarge ตัวอย่างกริด BS4

Bootstrap 4 อื่นๆ

เทมเพลตพื้นฐาน BS4 แบบฝึกหัด BS4 แบบทดสอบ BS4

Bootstrap 4 อ้างอิง

ทุกชั้นเรียน JS Alert ปุ่ม JS JS Carousel JS ยุบ JS Dropdown JS Modal JS Popover JS Scrollspy JS แท็บ JS Toasts JS Tooltip


ปุ่ม Bootstrap 4 JS


คลาส CSS ของปุ่ม

สำหรับบทแนะนำเกี่ยวกับปุ่ม โปรดอ่านบทแนะนำเกี่ยวกับปุ่มบูตสแตรปของ เรา

คลาสด้านล่างสามารถใช้เพื่อจัดรูปแบบ <a>, <button> หรือ <input> องค์ประกอบใด ๆ :

Class Description Example
.btn Adds basic styling to any button
.btn-block Makes a block-level button (spans the full width of the parent element)
.btn-danger Indicates a dangerous or potentially negative action
.btn-dark Dark grey button
.btn-default Indicates a default/standard button
.btn-info Contextual button for informational alert messages
.btn-lg Makes a large button
.btn-light Light grey button
.btn-link Makes a button look like a link (will still have button behavior)
.btn-outline-* Creates an outlined/bordered button. Use any of the contextual classes as * (btn-outline-primary, btn-outline-success, etc)
.btn-primary Provides extra visual weight and identifies the primary action in a set of buttons
.btn-sm Makes a small button
.btn-success Indicates a successful or positive action
.btn-secondary Indicates a "less" important action
.btn-toolbar Combine sets of button groups into button toolbars for more complex components
.btn-warning Indicates caution should be taken with this action
.active Makes the button appear pressed
.disabled Makes the button disabled

ผ่าน JavaScript

เปิดใช้งานด้วยตนเองด้วย:

$('.btn').button();

ตัวเลือกปุ่ม

None

วิธีการของปุ่ม

ตารางต่อไปนี้แสดงรายการวิธีปุ่มที่ใช้ได้ทั้งหมด

หมายเหตุ:สามารถส่งเมธอดผ่านแอตทริบิวต์ข้อมูลได้เช่นกัน ผนวกชื่อเมธอดต่อ data- เช่นเดียวกับ data-toggle หรือ data-dispose

Method Description Try it
.button("toggle") Makes the button look pressed
.button("dispose") Destroys an element's button