rich-text里面的标签宽度比较宽,相要在小程序中控制最大宽度为100%也就是屏幕的宽度 ,如何控制?想要把所有的比较大的宽度的标签 如section标签等的width都 给一个max-width:100%
如何在小程序中控制rich-text里面内容的样式?How to control the style of the content in rich-text in the applet?
如何在小程序中控制rich-text里面内容的样式?rich-text里面的标签宽度比较宽,相要在小程序中控制最大宽度为100%也就是屏幕的宽度 ,如何控制?想要把所有的比较大的宽度的标签 如section标签等的width都 给一个max-width:100%
Rich text inside the label width is relatively wide, in order to control the maximum width in the small program is 100%, that is, the width of the screen, how to control? You want to give a max width of 100% for all tags with larger width, such as section tags
回答:
看下你rich-text返回的是什么标签,比如有图片,我给图片加上一个richImg的class类名,然后再css定义richImg
css
max-width: 100%
我是给p标签追加了一个类,图片的话最大宽度100%