Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/syntax/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ Or, use the `image` directive.
:width: 250px
:::

### Image centering

Images that are not full width are automatically centered within their container. This is particularly useful when you specify a width constraint:

```markdown
:::{image} /syntax/images/apm.png
:alt: APM Logo
:width: 200px
:::
```

:::{image} /syntax/images/apm.png
:alt: APM Logo
:width: 200px
:::

The image above is centered because it has a width of 200px, which is less than the full container width.

## Screenshots

Screenshots are images displayed with a box-shadow. Define a screenshot by adding the `:screenshot:` attribute to a block-level image directive.
Expand Down
4 changes: 2 additions & 2 deletions src/Elastic.Documentation.Site/Assets/markdown/images.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
a.image-reference {
@apply mt-4 block align-middle;
& > img {
@apply block;
@apply mx-auto block;
}
}
/*
/*
* tailwind reset makes all images `display: block`
* this resets it to `display: initial`
*/
Expand Down
Loading