【问题标题】:I want to put width and height directly in the style tag using quill-image-resize-module in vue2-editor我想在 vue2-editor 中使用 quill-image-resize-module 将宽度和高度直接放在样式标签中
【发布时间】:2019-12-19 22:05:30
【问题描述】:

我在vue2-editor中使用quill-image-resize-module实现了resize in image,但是现在img中添加了width属性,我想把它复制到style属性中。

在我做的实现中,img标签是css with width: calc (100% + 32px);

因为有翻译并且无法更正,我希望能够通过将尺寸放入带有样式的图像中来显示比指定尺寸更小或更大的东西。

目前的情况是这样的。

<img alt src="https://**********" width="100px">

我想改成这样。

<img alt src="https://**********" style="width:100px">

【问题讨论】:

  • 请更清楚地解释此更改背后的目的,以便社区能够提供帮助
  • 我写了为什么这次需要这个实现。

标签: javascript vue.js editor nuxt.js


【解决方案1】:

尝试将样式标签移动到您的 css:

.img {
  width: 100px !important;
}

或者如果你使用了其他不应该调整的img标签:

你的 CSS:

#yourChoosenId {
  width: 100px !important;
}

你的html:

<img alt src="https://**********" id="yourChoosenId">

【讨论】:

    猜你喜欢
    • 2021-03-08
    • 2020-01-11
    • 1970-01-01
    • 1970-01-01
    • 2014-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-14
    相关资源
    最近更新 更多