Closed csss1234 closed 3 years ago
You can use the same logic:
.oz-image-widget img:not([width]){
width: 40%;
}
Thanks! Works great. I ended up using
.oz-image-widget img:not([width]){
max-width: 250px;
}
and combining it with code borrowed from Kepano
.oz-image-widget img:active {
max-height:100%;
max-width:100%;
height:100%;
width:100%;
object-fit: contain;
margin:0 auto;
text-align:center;
top: 50%;
transform: translateY(-50%);
padding:0;
left:0;
right:0;
bottom:0;
background:var(--background-primary);}
To get zoomable thumbnails : )
Nice!, And how can one change the default size in editor mode?
This does not work
div.oz-image-widget{ max-width: 75%; }
Nice!, And how can one change the default size in editor mode? This does not work
div.oz-image-widget{ max-width: 75%; }
You are trying to size the div
. It won't work. You need to target the image:
div.oz-image-widget img{
max-width: 75%
}
thanks, but this does not work either. Even adding the important property
div.oz-image-widget img{ max-width: 75% !important; }
Then you need to check your other custom CSS snippets. There should be a some styling, which takes more priority if !important
even doesn't work. You can try in an empty vault to see which part causes this issue.
ok, it works after restarting obsidian. For some reason the changes do not get applied immediately. Thanks for your help
using Minimal theme, I have a css snippet that renders all images as 40% size in preview mode
.markdown-preview-view .image-embed img:not([width]) { width:40%; }
is there a way to do the same in editor?