Issue with css image scaling

Hi, new obsidian and css user. I have a snippet for increasing line width to 1000px so I also wanted all the images I paste to be of that width too. I know you can enter the width while pasting the link but I find it annoying.

I made a snippet for this that looks like:

img {
  min-width: 1000px;
  height: auto;
}

It all seemed fine until I found out the source mode looked like this:

Please do note that I have two other snippets that increase line width and make image corners round. Please let me know if that makes any difference.

Is there any fix to this? or is the only way to do it is by manually typing in width?

I had to zoom the Obsidian UI all the way out to fit this in. Using your snippet above, the embedded ![[cat 1.png]] syntax works OK, but [[links]] or [[links.png]] have the long boxes. Using min-width: is creating the boxes. You don’t want that. :-1:

Give this a try instead. I’m unclear on what you are going for, but it may work better →

img {
  width: 1000px;
  height: auto;
}

1 Like

It is working!! I searched up online for css syntax for image modification and found a partial solution in the w3schools website; that’s why I used min-width in the first place :sweat_smile: Thanks so much for the help and have a great day! :smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.