vue-markdown
vue-markdown copied to clipboard
Img width not adpat to the parent div
When the img
rendered in the div
, its size doesn't adapt to the parent div's
width, if this img over the div's width, it will exceed the div. And setting the css is not useful for the img.
Any news on this? Facing same issue and not sure how to apply extra css to images rendered inside vue-markdown
Appreciate any suggestion.
@leosdutra I had the exact same problem and solved it by removing the scoped
attribute from the <style></style>
tag in the SFC.
I initally had scoped style in the SFC like this,
<style scoped> img { width: 100%; } </style>
which translates to
img[data-v-<uniq_random_id>] { width: 100%; }
However, the component doesn't seem to pass down that id properly to the image element and therefore the style is not applied. Removing the scoped attribute therefore solves it.
Hopefully you have a similar set up and this helps.
A neater solution would be for the component to attach the id to all of its rendered elements, I think.