mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-10-23 10:46:13 +02:00
913 B
913 B
layout, title, description, keywords
layout | title | description | keywords |
---|---|---|---|
layouts/post.njk | Modal | Create a modal with CSS flexbox | css dialog, css flexbox, css modal |
HTML
<div class="modal">
<!-- Header -->
<div class="modal__header">
<!-- Title -->
...
<!-- Close icon sticks to the right -->
...
</div>
<!-- Content -->
...
<!-- Footer -->
<div class="modal__footer">
...
</div>
</div>
CSS
.modal {
/* Border */
border: 1px solid #d1d5db;
border-radius: 0.25rem;
}
.modal__header {
display: flex;
justify-content: space-between;
/* Border */
border-bottom: 1px solid #d1d5db;
}
.modal__footer {
display: flex;
/* Push the buttons to the right */
justify-content: flex-end;
/* Border */
border-top: 1px solid #d1d5db;
}
{% demo %} {% include "covers/modal.njk" %} {% enddemo %}