I once tried (and researched) on making a div float next to the other text. I found the correct markup, but it stranded due to Obsidian partially loading and unloading parts of larger text.
I’m imagining you’ll run into the same kind of issue, unless you attach some javascript or other means to actually make it stay loaded related to the note when it normally would be unloaded.