Modal Example - Bulma Typing CST Test
Loading…
Modal Example — Bulma Code
Shows how to create a modal dialog that can be opened and closed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css" rel="stylesheet">
<title>Bulma Modal</title>
</head>
<body>
<section class="section">
<div class="container">
<button id="openModal" class="button is-primary">Open Modal</button>
<div id="modal" class="modal">
<div class="modal-background"></div>
<div class="modal-content box">Hello, this is a modal!</div>
<button class="modal-close is-large" aria-label="close"></button>
</div>
</div>
</section>
<script>
const modal = document.getElementById('modal');
document.getElementById('openModal').onclick = () => modal.classList.add('is-active');
document.querySelectorAll('.modal-close, .modal-background').forEach(el => el.onclick = () => modal.classList.remove('is-active'));
</script>
</body>
</html>Bulma Language Guide
Bulma is a modern, open-source CSS framework based entirely on Flexbox. It provides a clean, responsive, and modular approach to building web interfaces without any JavaScript dependencies.
Primary Use Cases
- ▸Responsive websites and web apps
- ▸Landing pages and marketing sites
- ▸Admin dashboards
- ▸Rapid prototyping
- ▸Projects requiring minimal JavaScript dependencies
Notable Features
- ▸Flexbox-based responsive grid
- ▸Pre-styled components and elements
- ▸Modular CSS import system
- ▸No JavaScript dependencies
- ▸Customizable via Sass variables
Origin & Creator
Created by Jeremy Thomas in 2016 to provide a simple, modern, and fully Flexbox-based CSS framework.
Industrial Note
Bulma is often used in lightweight web apps, marketing sites, admin dashboards, and projects where JS-free CSS frameworks are preferred.