initial commit
Some checks failed
Build, Test & Publish / Build and Publish Container Image (push) Has been cancelled
Build, Test & Publish / Deploy to Infrastructure (push) Has been cancelled
Build, Test & Publish / Build (push) Has been cancelled

This commit is contained in:
2024-09-05 13:54:08 +10:00
commit 8ad5845efc
57 changed files with 6046 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

3
docs/css/index.md Normal file
View File

@ -0,0 +1,3 @@
# CSS Snippets and Musings
#### [Text Width Horizontal Rule](./text-width-hr.md)

34
docs/css/text-width-hr.md Normal file
View File

@ -0,0 +1,34 @@
# Text Width Horizontal Rule
Often times, you want to create a horizontal rule that spans the width of the text. This is a simple way to do that.
```css
.hr {
display: inline-block;
}
.hr::after {
content: '';
display: block;
border-top: 2px solid black;
margin-top: .1rem;
}
```
In the above snippet we create a horizontal rule that spans the width of the text. We do this by creating a block element with `display: inline-block` and then adding a pseudo element with `display: block` and a border. The `margin-top` is used to create some space between the text and the horizontal rule.
This is how it looks:
```html
<p>
This is some normal text
</p>
<h2 class="hr">This is a heading</h2>
<p>
This is some more normal text
</p>
```
Which will render as:
<img src="./images/text-width-hr.png" alt="Text Width Horizontal Rule Example" style="max-width: 100%;">