It is possible to add a background image to your notes. You can only reference an image on the web. Nevertheless, if you do want to use your own image, upload it to a specialized website, e.g. Imgur, then reference it there. Check out the “Images” header.
I have also added some code to hide and show on hover the Preview/Edit icon in the ribbon. I don’t use that icon because I use Cmd/Ctrl+E. Check out header “Ribbons”.
If you have more time (like me )
you can use Node.js to impersonate the local server so you can access the localhost:1080 to get the local image
Unfortunately,I don’t script this process…
Obsidian does not support dragging the location of local images, so you can use http-server to simulate your computer into a Web Server, so that you can set the size and location of local images.
I tried to achieve this image in CSS before.
Unfortunately, I’ve been using CSS for too short a time to be successful.
To be honest, I wonder if there are other ways to do something like this (after all, it takes extra software and configuration).
You can achieve this pretty easily with a CSS but it’s easier to explain/show than type out so I’ll record a video. This is an example of what it looks like though:
You can also put images and quotes inline with paragraph elements in a similar way. You can then get as creative as you want with other elements. Here’s a random hipster-ipsum generated example with two different image types (it links to the same image but calls a different style in the MD file) and an embedded reference:
The good news: I kept my promise and recorded a video on how to do these snippets The bad news: It was over 3 hours long and was mostly me rambling and going off on tangents. The better news: I was procrastinating important things this weekend. How is that better news?: It means that I downloaded resolve then spent the entire weekend playing around with it. I also managed to edit 3 hours of content down to under 12 mins.
Here is the code for the image snippets. Most of the attributes are customizable so feel free to change them to fit your theme/use case. You can also copy/paste and change the reference to make as many different pseudo classes as you want.
This is for making a side bar quote that is often seen in webpages, books, physical print media. There are some drawbacks to this (see video for details) compared to the images. Also, feel free to change the details to match your theme (especially the font options since those I chose at random and probably won’t match your theme or anything else)
Update: I just watched the video. Absolutely amazing. You should mention this in the #css-themes channel on Discord !! I will also add it to my public code snippets file at the top of this page.
Even resident CSS guru () @death.au will probably be impressed with your code.
I want to thank you for that video, which is a very good presentation, you speak clearly and at the right speed, and explain the various CSS elements well. I am truly impressed!
This is marvellous @Lithou, thankyou so much. I have called up an iFrame with the #portrait snippet, and I now have a clock (onliveclock.com) always in the corner of my (admittedly preview only) window as I scroll up and down. Love it!
even resident CSS guru () @death.au will probably be impressed.
Yep. This is some good stuff! Using suffixes on links and targeting them specifically is genius!
Also, I found a way to get around your blockref problem for the Side-bar Quote Snippet. Change [src$="-sbq"] to [alt="sbq"] and use the pipe syntax to specify that alt (e.g. ![[I am freeman#^234f1c|sbq]]).
Interestingly, exactly the same thing (pipe syntax / alt) works for images too.