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

feat: Update contents

This commit is contained in:
Phuoc Nguyen
2023-08-19 19:27:15 +07:00
parent f7af6da9e4
commit 71d51b358a
318 changed files with 15536 additions and 6884 deletions

78
contents/spinner.mdx Normal file
View File

@@ -0,0 +1,78 @@
---
category: Feedback
created: '2022-10-03'
description: Create a loading spinner with CSS
keywords: css loading spinner, css spinner
thumbnail: /assets/css-layout/thumbnails/spinner.png
title: Spinner
---
## HTML
```html
<div class="spinner"></div>
```
## CSS
```css
.spinner {
/* Size */
height: 4rem;
width: 4rem;
/* Create a curve at the top */
border: 4px solid #d1d5db;
border-top-color: #3b82f6;
border-radius: 50%;
animation: spinner 800ms linear infinite;
}
@keyframes spinner {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
```
<Playground>
```css styles.css hidden
body {
align-items: center;
display: flex;
justify-content: center;
}
.spinner {
height: 4rem;
width: 4rem;
border: 4px solid #d1d5db;
border-top-color: #3b82f6;
border-radius: 50%;
animation: spinner 800ms linear infinite;
}
@keyframes spinner {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
```
```html index.html hidden
<div class="spinner"></div>
```
</Playground>
## See also
- [Indeterminate progress bar](https://phuoc.ng/collection/css-layout/indeterminate-progress-bar)