Skip to content

How do I add frames around images? #6410

Discussion options

You must be logged in to vote

Hello,
you can add a border to all images via some additional css:
https://squidfunk.github.io/mkdocs-material/customization/#additional-css

.md-content img {
  border-width: 1px;
  border-style: solid;
  border-color: black;
}

The .md-content selector is required to avoid adding a border to the logo in the header.
Instead of a rigid black color, perhaps you'd prefer a dynamic color that matches the selected palette.
For example you can use border-color: var(--md-accent-fg-color);, as for other predefined color variables please reference this page:
https://github.com/squidfunk/mkdocs-material/blob/master/src/templates/assets/stylesheets/main/_colors.scss


As a side note, even though it's …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@YevheniiPokhvalii
Comment options

@kamilkrzyskow
Comment options

Answer selected by squidfunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants