Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enlarge on hover CSS #68

Open
SteveJohnSteele opened this issue Jan 18, 2024 · 0 comments
Open

Enlarge on hover CSS #68

SteveJohnSteele opened this issue Jan 18, 2024 · 0 comments

Comments

@SteveJohnSteele
Copy link

SteveJohnSteele commented Jan 18, 2024

/* Apply styles to images with alt text containing "enlarge" */
.markdown-preview-view img[alt*="enlarge"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: transform 0.25s ease;
}

/* Hover effect on images with alt text containing "enlarge" */
.markdown-preview-view img[alt*="enlarge"]:hover {
  -webkit-transform: scale(1.8); /* experiment with values */
  transform: scale(2);
}

It only targets links with the "enlarge" tag.

How to use:
![enlarge | 100](https://upload.wikimedia.org/wikipedia/commons/e/e0/SNice.svg)
or
![some text enlarge more text | 100](https://upload.wikimedia.org/wikipedia/commons/e/e0/SNice.svg)

This allows the user to set a default size and still have the enlarged hover effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant