1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-05 05:37:29 +02:00

feat: Add file names to snippets

This commit is contained in:
Phuoc Nguyen
2023-09-01 07:43:57 +07:00
parent c9c8bbdb1f
commit a080bf3966
106 changed files with 234 additions and 212 deletions

View File

@@ -9,7 +9,7 @@ title: Accordion
## HTML ## HTML
```html ```html index.html
<!-- Container --> <!-- Container -->
<div class="accordion"> <div class="accordion">
<!-- Collapsed item --> <!-- Collapsed item -->
@@ -37,7 +37,7 @@ title: Accordion
## CSS ## CSS
```css ```css styles.css
.accordion { .accordion {
/* Border */ /* Border */
border: 1px solid #d1d5db; border: 1px solid #d1d5db;

View File

@@ -10,7 +10,7 @@ updated: '2021-04-01'
## HTML ## HTML
```html ```html index.html
<!-- Up arrow button --> <!-- Up arrow button -->
<button class="arrow-buttons"> <button class="arrow-buttons">
<!-- Arrow --> <!-- Arrow -->
@@ -50,7 +50,7 @@ updated: '2021-04-01'
## CSS ## CSS
```css ```css styles.css
.arrow-button { .arrow-button {
/* Transparent background */ /* Transparent background */
background-color: transparent; background-color: transparent;

View File

@@ -9,7 +9,7 @@ title: Avatar list
## HTML ## HTML
```html ```html index.html
<div class="avatars"> <div class="avatars">
<!-- Avatar item --> <!-- Avatar item -->
<div class="avatars__item"> <div class="avatars__item">
@@ -26,7 +26,7 @@ title: Avatar list
## CSS ## CSS
```css ```css styles.css
.avatars { .avatars {
display: flex; display: flex;
} }

View File

@@ -9,7 +9,7 @@ title: Avatar
## HTML ## HTML
```html ```html index.html
<div class="avatar"> <div class="avatar">
<!-- Avatar image --> <!-- Avatar image -->
<img class="avatar__image" src="..." /> <img class="avatar__image" src="..." />
@@ -18,7 +18,7 @@ title: Avatar
## CSS ## CSS
```css ```css styles.css
.avatar { .avatar {
/* Rounded border */ /* Rounded border */
border-radius: 50%; border-radius: 50%;

View File

@@ -9,13 +9,13 @@ title: Badge
## HTML ## HTML
```html ```html index.html
<div class="badge">...</div> <div class="badge">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
.badge { .badge {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Box selector
## HTML ## HTML
```html ```html index.html
<div class="box-selector">...</div> <div class="box-selector">...</div>
<!-- The selected variant --> <!-- The selected variant -->
@@ -18,7 +18,7 @@ title: Box selector
## CSS ## CSS
```css ```css styles.css
.box-selector { .box-selector {
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
border-radius: 0.25rem; border-radius: 0.25rem;

View File

@@ -9,7 +9,7 @@ title: Breadcrumb
## HTML ## HTML
```html ```html index.html
<div class="breadcrumb"> <div class="breadcrumb">
<!-- Breadcrumb item --> <!-- Breadcrumb item -->
<div class="breadcrumb__item">...</div> <div class="breadcrumb__item">...</div>
@@ -21,7 +21,7 @@ title: Breadcrumb
## CSS ## CSS
```css ```css styles.css
.breadcrumb { .breadcrumb {
/* Content is centered vertically */ /* Content is centered vertically */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Button with icon
## HTML ## HTML
```html ```html index.html
<button class="button-with-icon"> <button class="button-with-icon">
<!-- Icon --> <!-- Icon -->
... ...
@@ -21,7 +21,7 @@ title: Button with icon
## CSS ## CSS
```css ```css styles.css
.button-with-icon { .button-with-icon {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Calendar
## HTML ## HTML
```html ```html index.html
<div class="calendar"> <div class="calendar">
<!-- Week days --> <!-- Week days -->
<div class="calendar__weekday">Mon</div> <div class="calendar__weekday">Mon</div>
@@ -39,7 +39,7 @@ title: Calendar
## CSS ## CSS
```css ```css styles.css
.calendar { .calendar {
display: grid; display: grid;
grid-template-columns: repeat(7, 1fr); grid-template-columns: repeat(7, 1fr);

View File

@@ -9,7 +9,7 @@ title: Card layout
## HTML ## HTML
```html ```html index.html
<div class="card-layout"> <div class="card-layout">
<!-- A card with given width --> <!-- A card with given width -->
<div class="card-layout__item">...</div> <div class="card-layout__item">...</div>
@@ -21,7 +21,7 @@ title: Card layout
## CSS ## CSS
```css ```css styles.css
.card-layout { .card-layout {
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Card
## HTML ## HTML
```html ```html index.html
<div class="card"> <div class="card">
<!-- Cover --> <!-- Cover -->
<div class="card__cover">...</div> <div class="card__cover">...</div>
@@ -22,7 +22,7 @@ title: Card
## CSS ## CSS
```css ```css styles.css
.card { .card {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -9,13 +9,13 @@ title: Centering
## HTML ## HTML
```html ```html index.html
<div class="centering">...</div> <div class="centering">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
.centering { .centering {
align-items: center; align-items: center;
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Chip
## HTML ## HTML
```html ```html index.html
<div class="chip"> <div class="chip">
<!-- Content --> <!-- Content -->
<div class="chip__content">...</div> <div class="chip__content">...</div>
@@ -24,7 +24,7 @@ title: Chip
## CSS ## CSS
```css ```css styles.css
.chip { .chip {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Circular navigation
## HTML ## HTML
```html ```html index.html
<div class="circular-navigation"> <div class="circular-navigation">
<!-- The trigger element that will show all circles when user clicks it --> <!-- The trigger element that will show all circles when user clicks it -->
... ...
@@ -27,7 +27,7 @@ title: Circular navigation
## CSS ## CSS
```css ```css styles.css
.circular-navigation { .circular-navigation {
position: relative; position: relative;
} }

View File

@@ -9,7 +9,7 @@ title: Close button
## HTML ## HTML
```html ```html index.html
<button class="close-button"> <button class="close-button">
<div class="close-button__line close-button__line--first"></div> <div class="close-button__line close-button__line--first"></div>
<div class="close-button__line close-button__line--second"></div> <div class="close-button__line close-button__line--second"></div>
@@ -18,7 +18,7 @@ title: Close button
## CSS ## CSS
```css ```css styles.css
.close-button { .close-button {
/* Reset */ /* Reset */
background-color: transparent; background-color: transparent;

View File

@@ -9,7 +9,7 @@ title: Color swatch
## HTML ## HTML
```html ```html index.html
<div class="swatch"> <div class="swatch">
<div class="swatch__item" style="background-color: ..."></div> <div class="swatch__item" style="background-color: ..."></div>
@@ -20,7 +20,7 @@ title: Color swatch
## CSS ## CSS
```css ```css styles.css
.swatch { .swatch {
/* Wrap the items */ /* Wrap the items */
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Concave corners
## HTML ## HTML
```html ```html index.html
<div class="concave-corners"> <div class="concave-corners">
<!-- The top-left corner --> <!-- The top-left corner -->
<div class="concave-corners__corner concave-corners__corner--tl"></div> <div class="concave-corners__corner concave-corners__corner--tl"></div>
@@ -30,7 +30,7 @@ title: Concave corners
## CSS ## CSS
```css ```css styles.css
.concave-corners { .concave-corners {
background-color: #d1d5db; background-color: #d1d5db;

View File

@@ -9,7 +9,7 @@ title: Cookie banner
## HTML ## HTML
```html ```html index.html
<div class="cookie-banner"> <div class="cookie-banner">
<!-- Tells visitors that the website uses cookie --> <!-- Tells visitors that the website uses cookie -->
<div class="cookie-banner__content">...</div> <div class="cookie-banner__content">...</div>
@@ -21,7 +21,7 @@ title: Cookie banner
## CSS ## CSS
```css ```css styles.css
.cookie-banner { .cookie-banner {
/* Banner is displayed at the bottom */ /* Banner is displayed at the bottom */
bottom: 0; bottom: 0;

View File

@@ -9,7 +9,7 @@ title: Corner ribbon
## HTML ## HTML
```html ```html index.html
<div class="corner-ribbon"> <div class="corner-ribbon">
<!-- The container --> <!-- The container -->
<div class="corner-ribbon__inner"> <div class="corner-ribbon__inner">
@@ -21,7 +21,7 @@ title: Corner ribbon
## CSS ## CSS
```css ```css styles.css
.corner-ribbon { .corner-ribbon {
position: relative; position: relative;
} }

View File

@@ -9,7 +9,7 @@ title: Curved background
## HTML ## HTML
```html ```html index.html
<div class="curved-background"> <div class="curved-background">
<div class="curved-background__curved"></div> <div class="curved-background__curved"></div>
</div> </div>
@@ -17,7 +17,7 @@ title: Curved background
## CSS ## CSS
```css ```css styles.css
.curved-background__curved { .curved-background__curved {
/* Background color */ /* Background color */
background-color: #d1d5db; background-color: #d1d5db;

View File

@@ -9,7 +9,7 @@ title: Custom checkbox button
## HTML ## HTML
```html ```html index.html
<label class="custom-checkbox-button"> <label class="custom-checkbox-button">
<!-- The real checkbox --> <!-- The real checkbox -->
<input type="checkbox" class="custom-checkbox-button__input" /> <input type="checkbox" class="custom-checkbox-button__input" />
@@ -27,7 +27,7 @@ title: Custom checkbox button
## CSS ## CSS
```css ```css styles.css
.custom-checkbox-button { .custom-checkbox-button {
/* Center the content horizontally */ /* Center the content horizontally */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Custom radio button
## HTML ## HTML
```html ```html index.html
<label class="custom-radio-button"> <label class="custom-radio-button">
<!-- The real radio --> <!-- The real radio -->
<input type="radio" class="custom-radio-button__input" /> <input type="radio" class="custom-radio-button__input" />
@@ -27,7 +27,7 @@ title: Custom radio button
## CSS ## CSS
```css ```css styles.css
.custom-radio-button { .custom-radio-button {
/* Center the content horizontally */ /* Center the content horizontally */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Diagonal section
## HTML ## HTML
```html ```html index.html
<div class="diagonal-section"> <div class="diagonal-section">
<!-- The diagonal area --> <!-- The diagonal area -->
<div class="diagonal-section__diagonal"></div> <div class="diagonal-section__diagonal"></div>
@@ -21,7 +21,7 @@ title: Diagonal section
## CSS ## CSS
```css ```css styles.css
.diagonal-section { .diagonal-section {
/* Used to position the diagonal area */ /* Used to position the diagonal area */
position: relative; position: relative;

View File

@@ -9,7 +9,7 @@ title: Docked at corner
## HTML ## HTML
```html ```html index.html
<div class="docked-at-corner"> <div class="docked-at-corner">
<!-- Docked at the top right corner --> <!-- Docked at the top right corner -->
<div class="docked-at-corner__docker"></div> <div class="docked-at-corner__docker"></div>
@@ -18,7 +18,7 @@ title: Docked at corner
## CSS ## CSS
```css ```css styles.css
.docked-at-corner { .docked-at-corner {
position: relative; position: relative;
} }
@@ -77,3 +77,7 @@ body {
</div> </div>
``` ```
</Playground> </Playground>
## See also
- Discover how to animate a docked element using the [pulse animation](https://phuoc.ng/collection/css-animation/pulse-animation)

View File

@@ -9,7 +9,7 @@ title: Dot leader
## HTML ## HTML
```html ```html index.html
<div class="dot-leader"> <div class="dot-leader">
<!-- Left side --> <!-- Left side -->
<div>...</div> <div>...</div>
@@ -24,7 +24,7 @@ title: Dot leader
## CSS ## CSS
```css ```css styles.css
.dot-leader { .dot-leader {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Dot navigation
## HTML ## HTML
```html ```html index.html
<div class="dot-navigation"> <div class="dot-navigation">
<div class="dot-navigation__item"></div> <div class="dot-navigation__item"></div>
@@ -20,7 +20,7 @@ title: Dot navigation
## CSS ## CSS
```css ```css styles.css
.dot-navigation { .dot-navigation {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -11,7 +11,7 @@ This pattern is also known as off-canvas.
## HTML ## HTML
```html ```html index.html
<div class="drawer"> <div class="drawer">
<!-- Backdrop --> <!-- Backdrop -->
<div class="drawer__overlay"></div> <div class="drawer__overlay"></div>
@@ -23,7 +23,7 @@ This pattern is also known as off-canvas.
## CSS ## CSS
```css ```css styles.css
.drawer { .drawer {
/* Take full size */ /* Take full size */
height: 100%; height: 100%;

View File

@@ -9,13 +9,13 @@ title: Drop area
## HTML ## HTML
```html ```html index.html
<div class="drop-area">...</div> <div class="drop-area">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
.drop-area { .drop-area {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,13 +9,13 @@ title: Drop cap
## HTML ## HTML
```html ```html index.html
<div class="drop-cap">...</div> <div class="drop-cap">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
.drop-cap:first-letter { .drop-cap:first-letter {
/* Display at the left */ /* Display at the left */
float: left; float: left;

View File

@@ -9,7 +9,7 @@ title: Dropdown
## HTML ## HTML
```html ```html index.html
<div class="dropdown"> <div class="dropdown">
<!-- The trigger element --> <!-- The trigger element -->
<div class="dropdown__trigger">...</div> <div class="dropdown__trigger">...</div>
@@ -21,7 +21,7 @@ title: Dropdown
## CSS ## CSS
```css ```css styles.css
.dropdown { .dropdown {
position: relative; position: relative;
} }

View File

@@ -11,7 +11,7 @@ The pattern is often used to indicate there is more content.
## HTML ## HTML
```html ```html index.html
<div class="fading-long-section"> <div class="fading-long-section">
<!-- Main content --> <!-- Main content -->
<div class="fading-long-section__content">...</div> <div class="fading-long-section__content">...</div>
@@ -23,7 +23,7 @@ The pattern is often used to indicate there is more content.
## CSS ## CSS
```css ```css styles.css
.fading-long-section { .fading-long-section {
/* Used to position the faded element */ /* Used to position the faded element */
position: relative; position: relative;
@@ -177,3 +177,7 @@ The pattern is often used to indicate there is more content.
</div> </div>
``` ```
</Playground> </Playground>
## See also
- [Customer logos marquee](https://phuoc.ng/collection/css-animation/customer-logos-marquee)

View File

@@ -9,7 +9,7 @@ title: Feature comparison
## HTML ## HTML
```html ```html index.html
<div class="feature-comparison"> <div class="feature-comparison">
<!-- Feature name --> <!-- Feature name -->
<div class="feature-comparison__feature">...</div> <div class="feature-comparison__feature">...</div>
@@ -33,7 +33,7 @@ title: Feature comparison
## CSS ## CSS
```css ```css styles.css
.feature-comparison { .feature-comparison {
align-items: center; align-items: center;
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Feature list
## HTML ## HTML
```html ```html index.html
<!-- Feature item --> <!-- Feature item -->
<div class="feature-list"> <div class="feature-list">
<!-- Image --> <!-- Image -->
@@ -25,7 +25,7 @@ title: Feature list
## CSS ## CSS
```css ```css styles.css
.feature-list { .feature-list {
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Fixed at corner
## HTML ## HTML
```html ```html index.html
<div class="fixed-at-corner"> <div class="fixed-at-corner">
<!-- Top-left corner --> <!-- Top-left corner -->
<div class="fixed-at-corner__corner fixed-at-corner__corner--tl">...</div> <div class="fixed-at-corner__corner fixed-at-corner__corner--tl">...</div>
@@ -27,7 +27,7 @@ title: Fixed at corner
## CSS ## CSS
```css ```css styles.css
.fixed-at-corner { .fixed-at-corner {
position: relative; position: relative;
} }

View File

@@ -9,7 +9,7 @@ title: Fixed at side
## HTML ## HTML
```html ```html index.html
<!-- Fixed at the middle of left side --> <!-- Fixed at the middle of left side -->
<div class="fixed-at-side fixed-at-side--l">...</div> <div class="fixed-at-side fixed-at-side--l">...</div>
@@ -19,7 +19,7 @@ title: Fixed at side
## CSS ## CSS
```css ```css styles.css
.fixed-at-side { .fixed-at-side {
position: fixed; position: fixed;
top: 50%; top: 50%;

View File

@@ -9,7 +9,7 @@ title: Floating label
## HTML ## HTML
```html ```html index.html
<div class="floating-label"> <div class="floating-label">
<!-- The input --> <!-- The input -->
<input placeholder="Placeholder" class="floating-label__input" /> <input placeholder="Placeholder" class="floating-label__input" />
@@ -21,7 +21,7 @@ title: Floating label
## CSS ## CSS
```css ```css styles.css
.floating-label { .floating-label {
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
border-radius: 0.25rem; border-radius: 0.25rem;
@@ -115,3 +115,7 @@ placeholder of input isn't shown
</div> </div>
``` ```
</Playground> </Playground>
## See also
- Explore some ways to [animate a floating label](https://phuoc.ng/collection/css-animation/floating-label).

View File

@@ -9,7 +9,7 @@ title: Folder structure
## HTML ## HTML
```html ```html index.html
<div class="folder-structure"> <div class="folder-structure">
<ul> <ul>
<li> <li>
@@ -42,7 +42,7 @@ title: Folder structure
## CSS ## CSS
```css ```css styles.css
:root { :root {
--folder-structure-item-height: 0.5rem; --folder-structure-item-height: 0.5rem;
--folder-structure-item-margin-left: 2.25rem; --folder-structure-item-margin-left: 2.25rem;

View File

@@ -9,13 +9,13 @@ title: Full background
## HTML ## HTML
```html ```html index.html
<div class="full-background">...</div> <div class="full-background">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
.full-background { .full-background {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Full screen menu
## HTML ## HTML
```html ```html index.html
<div class="full-screen-menu"> <div class="full-screen-menu">
<!-- The navigation menu --> <!-- The navigation menu -->
<ul> <ul>
@@ -23,7 +23,7 @@ title: Full screen menu
## CSS ## CSS
```css ```css styles.css
.full-screen-menu { .full-screen-menu {
/* Full screen overlay */ /* Full screen overlay */
height: 100%; height: 100%;

View File

@@ -9,7 +9,7 @@ title: Holy grail
## HTML ## HTML
```html ```html index.html
<div class="holy-grail"> <div class="holy-grail">
<header>...</header> <header>...</header>
<main class="holy-grail__main"> <main class="holy-grail__main">
@@ -28,7 +28,7 @@ title: Holy grail
## CSS ## CSS
```css ```css styles.css
.holy-grail { .holy-grail {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -9,7 +9,7 @@ title: Indeterminate progress bar
## HTML ## HTML
```html ```html index.html
<div class="indeterminate-progress-bar"> <div class="indeterminate-progress-bar">
<div class="indeterminate-progress-bar__progress"></div> <div class="indeterminate-progress-bar__progress"></div>
</div> </div>
@@ -17,7 +17,7 @@ title: Indeterminate progress bar
## CSS ## CSS
```css ```css styles.css
.indeterminate-progress-bar { .indeterminate-progress-bar {
/* Color */ /* Color */
background-color: #d1d5db; background-color: #d1d5db;

View File

@@ -9,13 +9,13 @@ title: Initial avatar
## HTML ## HTML
```html ```html index.html
<div class="initial-avatar">...</div> <div class="initial-avatar">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
.initial-avatar { .initial-avatar {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Input addon
## HTML ## HTML
```html ```html index.html
<!-- Add-on prepended --> <!-- Add-on prepended -->
<div class="input-addon"> <div class="input-addon">
<!-- Add-on --> <!-- Add-on -->
@@ -43,7 +43,7 @@ title: Input addon
## CSS ## CSS
```css ```css styles.css
.input-addon { .input-addon {
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
border-radius: 0.25rem; border-radius: 0.25rem;

View File

@@ -9,13 +9,13 @@ title: Inverted corners
## HTML ## HTML
```html ```html index.html
<div class="inverted-corners">...</div> <div class="inverted-corners">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
:root { :root {
--inverted-corners-background: #d1d5db; --inverted-corners-background: #d1d5db;
--inverted-corners-size: 2rem; --inverted-corners-size: 2rem;

View File

@@ -11,13 +11,13 @@ We use the native `kbd` tag to display the keyboard shortcut.
## HTML ## HTML
```html ```html index.html
<kbd class="keyboard-shortcut">...</kbd> <kbd class="keyboard-shortcut">...</kbd>
``` ```
## CSS ## CSS
```css ```css styles.css
.keyboard-shortcut { .keyboard-shortcut {
/* Background and color */ /* Background and color */
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);

View File

@@ -9,7 +9,7 @@ title: Layered card
## HTML ## HTML
```html ```html index.html
<div class="layered-card"> <div class="layered-card">
<div class="layered-card__content"></div> <div class="layered-card__content"></div>
</div> </div>
@@ -17,7 +17,7 @@ title: Layered card
## CSS ## CSS
```css ```css styles.css
.layered-card { .layered-card {
position: relative; position: relative;

View File

@@ -9,13 +9,13 @@ title: Lined paper
## HTML ## HTML
```html ```html index.html
<div class="lined-paper">...</div> <div class="lined-paper">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
.lined-paper { .lined-paper {
/* Lined background */ /* Lined background */
background-image: linear-gradient(#d1d5db 1px, transparent 0px); background-image: linear-gradient(#d1d5db 1px, transparent 0px);

View File

@@ -9,7 +9,7 @@ title: Masonry grid
## HTML ## HTML
```html ```html index.html
<div class="masonry-grid"> <div class="masonry-grid">
<!--Item --> <!--Item -->
<div class="masonry-grid__item">...</div> <div class="masonry-grid__item">...</div>
@@ -20,7 +20,7 @@ title: Masonry grid
## CSS ## CSS
```css ```css styles.css
.masonry-grid { .masonry-grid {
/* It is split into 3 columns */ /* It is split into 3 columns */
column-count: 3; column-count: 3;

View File

@@ -9,7 +9,7 @@ title: Media object
## HTML ## HTML
```html ```html index.html
<div class="media-object"> <div class="media-object">
<!-- Media object --> <!-- Media object -->
<div class="media-object__media">...</div> <div class="media-object__media">...</div>
@@ -20,7 +20,7 @@ title: Media object
## CSS ## CSS
```css ```css styles.css
.media-object { .media-object {
/* Align sub-items to top */ /* Align sub-items to top */
align-items: start; align-items: start;

View File

@@ -9,7 +9,7 @@ title: Mega menu
## HTML ## HTML
```html ```html index.html
<div class="mega-menu"> <div class="mega-menu">
<!-- Item --> <!-- Item -->
<div class="mega-menu__item">...</div> <div class="mega-menu__item">...</div>
@@ -30,7 +30,7 @@ title: Mega menu
## CSS ## CSS
```css ```css styles.css
.mega-menu { .mega-menu {
/* Used to position the mega menu */ /* Used to position the mega menu */
position: relative; position: relative;

View File

@@ -9,7 +9,7 @@ title: Menu
## HTML ## HTML
```html ```html index.html
<div class="menu"> <div class="menu">
<!-- Normal menu item --> <!-- Normal menu item -->
<div class="menu__item">...</div> <div class="menu__item">...</div>
@@ -41,7 +41,7 @@ title: Menu
## CSS ## CSS
```css ```css styles.css
.menu { .menu {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -9,7 +9,7 @@ title: Modal
## HTML ## HTML
```html ```html index.html
<div class="modal"> <div class="modal">
<!-- Header --> <!-- Header -->
<div class="modal__header"> <div class="modal__header">
@@ -29,7 +29,7 @@ title: Modal
## CSS ## CSS
```css ```css styles.css
.modal { .modal {
/* Border */ /* Border */
border: 1px solid #d1d5db; border: 1px solid #d1d5db;

View File

@@ -9,7 +9,7 @@ title: Nested dropdowns
## HTML ## HTML
```html ```html index.html
<ul class="nested-dropdowns"> <ul class="nested-dropdowns">
<li>A</li> <li>A</li>
<li> <li>
@@ -43,7 +43,7 @@ title: Nested dropdowns
## CSS ## CSS
```css ```css styles.css
.nested-dropdowns { .nested-dropdowns {
/* Border */ /* Border */
border: 1px solid #d1d5db; border: 1px solid #d1d5db;

View File

@@ -9,7 +9,7 @@ title: Notification
## HTML ## HTML
```html ```html index.html
<div class="notification"> <div class="notification">
<!-- Content --> <!-- Content -->
<div class="notification__body">...</div> <div class="notification__body">...</div>
@@ -24,7 +24,7 @@ title: Notification
## CSS ## CSS
```css ```css styles.css
.notification { .notification {
display: flex; display: flex;
} }

View File

@@ -9,7 +9,7 @@ title: Overlay play button
## HTML ## HTML
```html ```html index.html
<div class="overlay-play-button"> <div class="overlay-play-button">
<!-- The video element --> <!-- The video element -->
<video src="..." /> <video src="..." />
@@ -24,7 +24,7 @@ title: Overlay play button
## CSS ## CSS
```css ```css styles.css
.overlay-play-button { .overlay-play-button {
/* Used to position the overlay */ /* Used to position the overlay */
position: relative; position: relative;

View File

@@ -9,7 +9,7 @@ title: Pagination
## HTML ## HTML
```html ```html index.html
<div class="pagination"> <div class="pagination">
<!-- Pagination item --> <!-- Pagination item -->
<div class="pagination__item">...</div> <div class="pagination__item">...</div>
@@ -21,7 +21,7 @@ title: Pagination
## CSS ## CSS
```css ```css styles.css
.pagination { .pagination {
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Popover arrow
## HTML ## HTML
```html ```html index.html
<div class="popover-arrow"> <div class="popover-arrow">
<!-- The content --> <!-- The content -->
... ...
@@ -54,7 +54,7 @@ title: Popover arrow
## CSS ## CSS
```css ```css styles.css
.popover-arrow { .popover-arrow {
/* Border */ /* Border */
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
@@ -386,3 +386,8 @@ body {
</div> </div>
``` ```
</Playground> </Playground>
## See also
- [Speech bubble](https://phuoc.ng/collection/css-layout/speech-bubble)
- [Triangle buttons](https://phuoc.ng/collection/css-layout/triangle-buttons)

View File

@@ -9,7 +9,7 @@ title: Presence indicator
## HTML ## HTML
```html ```html index.html
<div class="presence-indicator"> <div class="presence-indicator">
<!-- Other element such as avatar --> <!-- Other element such as avatar -->
... ...
@@ -21,7 +21,7 @@ title: Presence indicator
## CSS ## CSS
```css ```css styles.css
.presence-indicator { .presence-indicator {
position: relative; position: relative;
} }

View File

@@ -9,7 +9,7 @@ title: Previous next buttons
## HTML ## HTML
```html ```html index.html
<div class="previous-next-buttons"> <div class="previous-next-buttons">
<!-- Previous link sticks to the left --> <!-- Previous link sticks to the left -->
<div class="previous-next-buttons__nav"> <div class="previous-next-buttons__nav">
@@ -25,7 +25,7 @@ title: Previous next buttons
## CSS ## CSS
```css ```css styles.css
.previous-next-buttons { .previous-next-buttons {
align-items: center; align-items: center;
display: flex; display: flex;

View File

@@ -9,13 +9,13 @@ title: Price tag
## HTML ## HTML
```html ```html index.html
<div class="price-tag">...</div> <div class="price-tag">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
:root { :root {
--price-tag-background: #d1d5db; --price-tag-background: #d1d5db;
--price-tag-height: 2rem; --price-tag-height: 2rem;

View File

@@ -9,7 +9,7 @@ title: Pricing table
## HTML ## HTML
```html ```html index.html
<div class="pricing-table"> <div class="pricing-table">
<!-- Pricing column --> <!-- Pricing column -->
<div class="pricing-table__column"> <div class="pricing-table__column">
@@ -33,7 +33,7 @@ title: Pricing table
## CSS ## CSS
```css ```css styles.css
.pricing-table { .pricing-table {
/* Content is centered horizontally */ /* Content is centered horizontally */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Progress bar
## HTML ## HTML
```html ```html index.html
<div class="container"> <div class="container">
<!-- Width based on the number of percentages --> <!-- Width based on the number of percentages -->
<div class="container__progress" style="width: 40%;"> <div class="container__progress" style="width: 40%;">
@@ -21,7 +21,7 @@ title: Progress bar
## CSS ## CSS
```css ```css styles.css
.progress-bar { .progress-bar {
/* Colors */ /* Colors */
background-color: #d1d5db; background-color: #d1d5db;

View File

@@ -9,7 +9,7 @@ title: Property list
## HTML ## HTML
```html ```html index.html
<!-- A property item --> <!-- A property item -->
<dl class="property-list"> <dl class="property-list">
<!-- Property name --> <!-- Property name -->
@@ -25,7 +25,7 @@ title: Property list
## CSS ## CSS
```css ```css styles.css
.property-list { .property-list {
/* Content is center horizontally */ /* Content is center horizontally */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Questions and answers
## HTML ## HTML
```html ```html index.html
<!-- Collapsed question and answer item --> <!-- Collapsed question and answer item -->
<div class="questions-and-answers__item questions-and-answers__item--collapsed"> <div class="questions-and-answers__item questions-and-answers__item--collapsed">
<!-- Heading --> <!-- Heading -->
@@ -31,7 +31,7 @@ title: Questions and answers
## CSS ## CSS
```css ```css styles.css
.questions-and-answers__item:not(:last-child) { .questions-and-answers__item:not(:last-child) {
border-bottom: 1px solid #d1d5db; border-bottom: 1px solid #d1d5db;
} }

View File

@@ -9,7 +9,7 @@ title: Radial progress bar
## HTML ## HTML
```html ```html index.html
<div class="radial-progress-bar"> <div class="radial-progress-bar">
<!-- Show number of percentages --> <!-- Show number of percentages -->
<div class="radial-progress-bar__percentages">...</div> <div class="radial-progress-bar__percentages">...</div>
@@ -27,7 +27,7 @@ title: Radial progress bar
## CSS ## CSS
```css ```css styles.css
:root { :root {
--radial-progress-bar-size: 8rem; --radial-progress-bar-size: 8rem;
--radial-progress-bar-border-width: 0.75rem; --radial-progress-bar-border-width: 0.75rem;

View File

@@ -9,7 +9,7 @@ title: Radio button group
## HTML ## HTML
```html ```html index.html
<div class="radio-button-group"> <div class="radio-button-group">
<!-- Each radio item --> <!-- Each radio item -->
<label class="radio-button-group__label"> <label class="radio-button-group__label">
@@ -30,7 +30,7 @@ title: Radio button group
## CSS ## CSS
```css ```css styles.css
.radio-button-group { .radio-button-group {
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Radio switch
## HTML ## HTML
```html ```html index.html
<div class="radio-switch"> <div class="radio-switch">
<!-- Radio container --> <!-- Radio container -->
<label class="radio-switch__label radio-switch__label--selected"> <label class="radio-switch__label radio-switch__label--selected">
@@ -26,7 +26,7 @@ title: Radio switch
## CSS ## CSS
```css ```css styles.css
.radio-switch { .radio-switch {
background-color: #d1d5db; background-color: #d1d5db;
border-radius: 9999px; border-radius: 9999px;

View File

@@ -9,7 +9,7 @@ title: Rating
## HTML ## HTML
```html ```html index.html
<div class="rating"> <div class="rating">
<button class="rating__star">☆</button> <button class="rating__star">☆</button>
<button class="rating__star">☆</button> <button class="rating__star">☆</button>
@@ -21,7 +21,7 @@ title: Rating
## CSS ## CSS
```css ```css styles.css
.rating { .rating {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Resizable element
## HTML ## HTML
```html ```html index.html
<div class="resizable-element"> <div class="resizable-element">
<!-- The content --> <!-- The content -->
... ...
@@ -42,7 +42,7 @@ title: Resizable element
## CSS ## CSS
```css ```css styles.css
.resizable-element { .resizable-element {
/* Border */ /* Border */
border: 1px dashed #d1d5db; border: 1px dashed #d1d5db;

View File

@@ -9,7 +9,7 @@ title: Ribbon
## HTML ## HTML
```html ```html index.html
<div class="ribbon"> <div class="ribbon">
<!-- The left side --> <!-- The left side -->
<div class="ribbon__side ribbon__side--l"></div> <div class="ribbon__side ribbon__side--l"></div>
@@ -30,7 +30,7 @@ title: Ribbon
## CSS ## CSS
```css ```css styles.css
.ribbon { .ribbon {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Same height columns
## HTML ## HTML
```html ```html index.html
<div class="same-height-columns"> <div class="same-height-columns">
<!-- Column --> <!-- Column -->
<div class="same-height-columns__column"> <div class="same-height-columns__column">
@@ -30,7 +30,7 @@ title: Same height columns
## CSS ## CSS
```css ```css styles.css
.same-height-columns { .same-height-columns {
display: flex; display: flex;
} }

View File

@@ -9,7 +9,7 @@ title: Search box
## HTML ## HTML
```html ```html index.html
<div class="search-box"> <div class="search-box">
<!-- Text input --> <!-- Text input -->
<input type="text" class="search-box__input" /> <input type="text" class="search-box__input" />
@@ -21,7 +21,7 @@ title: Search box
## CSS ## CSS
```css ```css styles.css
.search-box { .search-box {
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Separator
## HTML ## HTML
```html ```html index.html
<div class="separator"> <div class="separator">
<!-- Text --> <!-- Text -->
<div class="separator__content">...</div> <div class="separator__content">...</div>
@@ -21,7 +21,7 @@ title: Separator
## CSS ## CSS
```css ```css styles.css
.separator { .separator {
/* Content is centered horizontally */ /* Content is centered horizontally */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Sidebar
## HTML ## HTML
```html ```html index.html
<div class="sidebar"> <div class="sidebar">
<!-- Sidebar --> <!-- Sidebar -->
<aside class="sidebar__sidebar">...</aside> <aside class="sidebar__sidebar">...</aside>
@@ -21,7 +21,7 @@ title: Sidebar
## CSS ## CSS
```css ```css styles.css
.sidebar { .sidebar {
display: flex; display: flex;
} }

View File

@@ -9,7 +9,7 @@ title: Simple grid
## HTML ## HTML
```html ```html index.html
<!-- Row --> <!-- Row -->
<div class="simple-grid"> <div class="simple-grid">
<!--Cell with given width. Replace 25% with whatever you want --> <!--Cell with given width. Replace 25% with whatever you want -->
@@ -22,7 +22,7 @@ title: Simple grid
## CSS ## CSS
```css ```css styles.css
.simple-grid { .simple-grid {
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Slider
## HTML ## HTML
```html ```html index.html
<div class="slider"> <div class="slider">
<!-- Left side --> <!-- Left side -->
<!-- Width based on the current value --> <!-- Width based on the current value -->
@@ -25,7 +25,7 @@ title: Slider
## CSS ## CSS
```css ```css styles.css
.slider { .slider {
/* Content is centered horizontally */ /* Content is centered horizontally */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Spin button
## HTML ## HTML
```html ```html index.html
<div class="spin-button"> <div class="spin-button">
<!-- Input --> <!-- Input -->
<input type="text" class="spin-button__input" /> <input type="text" class="spin-button__input" />
@@ -27,7 +27,7 @@ title: Spin button
## CSS ## CSS
```css ```css styles.css
.spin-button { .spin-button {
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
border-radius: 0.25rem; border-radius: 0.25rem;

View File

@@ -9,13 +9,13 @@ title: Spinner
## HTML ## HTML
```html ```html index.html
<div class="spinner"></div> <div class="spinner"></div>
``` ```
## CSS ## CSS
```css ```css styles.css
.spinner { .spinner {
/* Size */ /* Size */
height: 4rem; height: 4rem;

View File

@@ -9,7 +9,7 @@ title: Split navigation
## HTML ## HTML
```html ```html index.html
<ul class="split-navigation"> <ul class="split-navigation">
<!-- Navigation item --> <!-- Navigation item -->
<li class="split-navigation__item"> <li class="split-navigation__item">
@@ -25,7 +25,7 @@ title: Split navigation
## CSS ## CSS
```css ```css styles.css
.split-navigation { .split-navigation {
/* Content is centered horizontally */ /* Content is centered horizontally */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Split screen
## HTML ## HTML
```html ```html index.html
<div class="split-screen"> <div class="split-screen">
<!-- Left content --> <!-- Left content -->
<div class="split-screen__half">...</div> <div class="split-screen__half">...</div>
@@ -21,7 +21,7 @@ title: Split screen
## CSS ## CSS
```css ```css styles.css
.split-screen { .split-screen {
display: flex; display: flex;
} }

View File

@@ -9,7 +9,7 @@ title: Stacked cards
## HTML ## HTML
```html ```html index.html
<div class="stacked-cards"> <div class="stacked-cards">
<!-- Repeat if you want to have more cards --> <!-- Repeat if you want to have more cards -->
<div class="stacked-cards__card"></div> <div class="stacked-cards__card"></div>
@@ -21,7 +21,7 @@ title: Stacked cards
## CSS ## CSS
```css ```css styles.css
.stacked-cards { .stacked-cards {
/* Used to position the stacked cards */ /* Used to position the stacked cards */
position: relative; position: relative;

View File

@@ -9,7 +9,7 @@ title: Stamp border
## HTML ## HTML
```html ```html index.html
<div class="stamp-border"> <div class="stamp-border">
<div class="stamp-border__content"></div> <div class="stamp-border__content"></div>
</div> </div>
@@ -17,7 +17,7 @@ title: Stamp border
## CSS ## CSS
```css ```css styles.css
.stamp-border { .stamp-border {
/* Background */ /* Background */
background-color: #d1d5db; background-color: #d1d5db;

View File

@@ -9,7 +9,7 @@ title: Statistic
## HTML ## HTML
```html ```html index.html
<div class="statistic"> <div class="statistic">
<!-- Value --> <!-- Value -->
<div class="statistic__value">...</div> <div class="statistic__value">...</div>
@@ -21,7 +21,7 @@ title: Statistic
## CSS ## CSS
```css ```css styles.css
.statistic { .statistic {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Status light
## HTML ## HTML
```html ```html index.html
<div class="status-light"> <div class="status-light">
<!-- Status light --> <!-- Status light -->
<div class="status-light__status"></div> <div class="status-light__status"></div>
@@ -21,7 +21,7 @@ title: Status light
## CSS ## CSS
```css ```css styles.css
.status-light { .status-light {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Stepper input
## HTML ## HTML
```html ```html index.html
<div class="stepper-input"> <div class="stepper-input">
<!-- Minus button --> <!-- Minus button -->
<button class="stepper-input__button">-</button> <button class="stepper-input__button">-</button>
@@ -26,7 +26,7 @@ title: Stepper input
## CSS ## CSS
```css ```css styles.css
.stepper-input { .stepper-input {
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Sticky footer
## HTML ## HTML
```html ```html index.html
<div class="sticky-footer"> <div class="sticky-footer">
<header class="sticky-footer__header">...</header> <header class="sticky-footer__header">...</header>
<main class="sticky-footer__main">...</main> <main class="sticky-footer__main">...</main>
@@ -19,7 +19,7 @@ title: Sticky footer
## CSS ## CSS
```css ```css styles.css
.sticky-footer { .sticky-footer {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -9,7 +9,7 @@ title: Sticky header
## HTML ## HTML
```html ```html index.html
<div> <div>
<header class="sticky-header__header">...</header> <header class="sticky-header__header">...</header>
<main>...</main> <main>...</main>
@@ -18,7 +18,7 @@ title: Sticky header
## CSS ## CSS
```css ```css styles.css
.sticky-header__header { .sticky-header__header {
/* Stick to the top */ /* Stick to the top */
position: sticky; position: sticky;

View File

@@ -9,7 +9,7 @@ title: Sticky sections
## HTML ## HTML
```html ```html index.html
<div class="sticky-sections"> <div class="sticky-sections">
<section class="sticky-sections__section">...</section> <section class="sticky-sections__section">...</section>
@@ -20,7 +20,7 @@ title: Sticky sections
## CSS ## CSS
```css ```css styles.css
.sticky-sections { .sticky-sections {
height: 100%; height: 100%;
overflow: scroll; overflow: scroll;

View File

@@ -9,7 +9,7 @@ title: Sticky table column
## HTML ## HTML
```html ```html index.html
<table class="sticky-table-column"> <table class="sticky-table-column">
<thead> <thead>
<tr> <tr>
@@ -29,7 +29,7 @@ title: Sticky table column
## CSS ## CSS
```css ```css styles.css
.sticky-table-headers__sticky { .sticky-table-headers__sticky {
/* Background color */ /* Background color */
background-color: #9ca3af; background-color: #9ca3af;

View File

@@ -9,7 +9,7 @@ title: Sticky table headers
## HTML ## HTML
```html ```html index.html
<table class="sticky-table-headers"> <table class="sticky-table-headers">
<thead> <thead>
<tr class="sticky-table-headers__sticky"></tr> <tr class="sticky-table-headers__sticky"></tr>
@@ -22,7 +22,7 @@ title: Sticky table headers
## CSS ## CSS
```css ```css styles.css
.sticky-table-headers__sticky { .sticky-table-headers__sticky {
/* Background color */ /* Background color */
background-color: #9ca3af; background-color: #9ca3af;

View File

@@ -11,7 +11,7 @@ The checkbox is placed inside a label. So when clicking on the label, the checkb
## HTML ## HTML
```html ```html index.html
<label class="switch switch--on"> <label class="switch switch--on">
<input type="checkbox" class="switch__input" /> <input type="checkbox" class="switch__input" />
@@ -29,7 +29,7 @@ The checkbox is placed inside a label. So when clicking on the label, the checkb
## CSS ## CSS
```css ```css styles.css
.switch { .switch {
display: flex; display: flex;

View File

@@ -9,7 +9,7 @@ title: Tab
## HTML ## HTML
```html ```html index.html
<div class="tab"> <div class="tab">
<!-- Active tab --> <!-- Active tab -->
<div class="tab__item tab__item--active">...</div> <div class="tab__item tab__item--active">...</div>
@@ -21,7 +21,7 @@ title: Tab
## CSS ## CSS
```css ```css styles.css
.tab { .tab {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,7 +9,7 @@ title: Teardrop
## HTML ## HTML
```html ```html index.html
<div class="teardrop"> <div class="teardrop">
<!-- Display the content vertically --> <!-- Display the content vertically -->
<div class="teardrop__content">...</div> <div class="teardrop__content">...</div>
@@ -18,7 +18,7 @@ title: Teardrop
## CSS ## CSS
```css ```css styles.css
.teardrop { .teardrop {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;

View File

@@ -9,13 +9,13 @@ title: Three dimensions card
## HTML ## HTML
```html ```html index.html
<div class="three-dimensions-card">...</div> <div class="three-dimensions-card">...</div>
``` ```
## CSS ## CSS
```css ```css styles.css
:root { :root {
--three-dimensions-card-left-side-width: 1rem; --three-dimensions-card-left-side-width: 1rem;
} }

View File

@@ -9,7 +9,7 @@ title: Timeline
## HTML ## HTML
```html ```html index.html
<div class="timeline"> <div class="timeline">
<!-- Left vertical line --> <!-- Left vertical line -->
<div class="timeline__line"></div> <div class="timeline__line"></div>
@@ -39,7 +39,7 @@ title: Timeline
## CSS ## CSS
```css ```css styles.css
.timeline { .timeline {
/* Used to position the left vertical line */ /* Used to position the left vertical line */
position: relative; position: relative;

View File

@@ -9,7 +9,7 @@ title: Toggle password visibility
## HTML ## HTML
```html ```html index.html
<div class="toggle-password-visibility"> <div class="toggle-password-visibility">
<!-- Text input --> <!-- Text input -->
<input type="text" class="toggle-password-visibility__input" /> <input type="text" class="toggle-password-visibility__input" />
@@ -21,7 +21,7 @@ title: Toggle password visibility
## CSS ## CSS
```css ```css styles.css
.toggle-password-visibility { .toggle-password-visibility {
display: flex; display: flex;

View File

@@ -12,7 +12,7 @@ updated: '2021-10-01'
## HTML ## HTML
```html ```html index.html
<div class="tooltip"> <div class="tooltip">
<!-- The tooltip content --> <!-- The tooltip content -->
<div class="tooltip__content">...</div> <div class="tooltip__content">...</div>
@@ -27,7 +27,7 @@ updated: '2021-10-01'
## CSS ## CSS
```css ```css styles.css
.tooltip { .tooltip {
/* Used to position the arrow */ /* Used to position the arrow */
position: relative; position: relative;

View File

@@ -9,7 +9,7 @@ title: Tree diagram
## HTML ## HTML
```html ```html index.html
<div class="tree-diagram"> <div class="tree-diagram">
<ul> <ul>
<li> <li>
@@ -42,7 +42,7 @@ title: Tree diagram
## CSS ## CSS
```css ```css styles.css
.tree-diagram ul { .tree-diagram ul {
display: flex; display: flex;
position: relative; position: relative;

View File

@@ -9,7 +9,7 @@ title: Triangle buttons
## HTML ## HTML
```html ```html index.html
<!-- Up triangle button --> <!-- Up triangle button -->
<button class="triangle-buttons"> <button class="triangle-buttons">
<!-- Triangle --> <!-- Triangle -->
@@ -49,7 +49,7 @@ title: Triangle buttons
## CSS ## CSS
```css ```css styles.css
.triangle-buttons { .triangle-buttons {
/* Center the content */ /* Center the content */
align-items: center; align-items: center;
@@ -170,3 +170,8 @@ body {
</div> </div>
``` ```
</Playground> </Playground>
## See also
- [Popover arrow](https://phuoc.ng/collection/css-layout/popover-arrow)
- [Speech bubble](https://phuoc.ng/collection/css-layout/speech-bubble)

View File

@@ -9,7 +9,7 @@ title: Upload button
## HTML ## HTML
```html ```html index.html
<div class="upload-button"> <div class="upload-button">
<!-- The real file input --> <!-- The real file input -->
<input type="file" class="upload-button__input" /> <input type="file" class="upload-button__input" />
@@ -24,7 +24,7 @@ title: Upload button
## CSS ## CSS
```css ```css styles.css
.upload-button { .upload-button {
/* Used to position the input */ /* Used to position the input */
position: relative; position: relative;

Some files were not shown because too many files have changed in this diff Show More