Home >Web Front-end >CSS Tutorial >Learn a CSS Framework in 6 Minutes with Bulma
Let's build a coding quotes page with Bulma, a modern CSS framework built on Flexbox. This tutorial complements the OpenSource Craft video (linked below). For context on why Bulma is a great choice, watch their introductory video [link to video].
We'll use Bulma's UI components: Hero banner, Columns, Cards, and Buttons.
First, install Bulma. Use npm install bulma
or import it directly into your HTML:
<code class="language-html"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.5.1/css/bulma.min.css"></code>
Next, create the Hero banner:
<code class="language-html"><section class="hero is-primary is-medium"> <div class="hero-body"> <div class="container"> <h1 class="title is-1">Coding Quotes</h1> <h2 class="subtitle">Like your favorites</h2> </div> </div> </section></code>
Now, let's build the columns:
<code class="language-html"><section class="section"> <div class="container"> <div class="columns"> <!-- Column content will go here --> </div> </div> </section></code>
Add three columns, each containing a card with a quote, author, and buttons:
<code class="language-html"><div class="column"> <div class="card"> <div class="card-content"> <h2 class="title">"Quote"</h2> <h3 class="subtitle">Programmer</h3> </div> <footer class="card-footer"> <a href="https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b" class="card-footer-item button is-success"><i class="fa fa-thumbs-o-up"></i></a> <a href="https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b" class="card-footer-item button is-danger"><i class="fa fa-thumbs-o-down"></i></a> <a href="https://www.php.cn/link/93ac0c50dd620dc7b88e5fe05c70e15b" class="card-footer-item button is-info"><i class="fa fa-retweet"></i></a> </footer> </div> </div></code>
Repeat this column structure twice more to complete the three-column layout.
For more Bulma resources, visit Bulma.io. For more tutorials like this, check out OpenSourceCraft.
(Note: Image URLs remain unchanged. The code is restructured for better readability and clarity, but the functionality remains the same.)
The above is the detailed content of Learn a CSS Framework in 6 Minutes with Bulma. For more information, please follow other related articles on the PHP Chinese website!