当前位置:金屋文档› Vue 设置v-html中元素样式

Vue 设置v-html中元素样式

文章标签:: css 前端 vue.js html javascript
文章摘要: Vue 设置v-html中元素样式

使用方式: <<< img { max-width: 100% }

如:要将v-html中的图片元素(img)的最大宽度设置为100%.

<template> <div > <div class="rtfDiv book" v-html="content"> </div> </div></template><script> export default { name: 'RtfView', props: { content: {}, }, data() { return { } }, }</script><style scoped> .rtfDiv >>> img { max-width: 100% ; } .rtfDiv { min-height: 700px; background-color: #fff; padding: 30px; margin : 15px 150px; }</style>
相关文档
  • 设置

  • 元素

  • 样式

相关文档推荐: