1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-22 05:33:15 +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

67
contents/drop-cap.mdx Normal file
View File

@@ -0,0 +1,67 @@
---
category: Display
created: '2019-11-29'
description: Create a drop cap with CSS
keywords: css drop cap, css :first-letter
thumbnail: /assets/css-layout/thumbnails/drop-cap.png
title: Drop cap
---
## HTML
```html
<div class="drop-cap">...</div>
```
## CSS
```css
.drop-cap:first-letter {
/* Display at the left */
float: left;
line-height: 1;
/* Spacing */
margin: 0 0.5rem 0 0;
padding: 0 0.5rem;
/* Optional */
border: 2px solid #d1d5db;
font-size: 2rem;
font-weight: 700;
}
```
<Playground>
```css styles.css hidden
body {
align-items: center;
display: flex;
justify-content: center;
}
.drop-cap {
overflow: hidden;
}
.drop-cap:first-letter {
border: 2px solid #d1d5db;
/* Display at the left */
float: left;
line-height: 1;
/* Spacing */
margin: 0 0.5rem 0 0;
padding: 0 0.5rem;
/* Optional */
font-size: 2rem;
font-weight: 700;
}
```
```html index.html hidden
<div class="drop-cap">
CSS is a style sheet language used for describing the presentation of a document written in a markup language like HTML. CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript.
</div>
```
</Playground>