收藏
回答

rich-text解析富文本出现空格?

会出现空白的解析???第一张图是ios真机,第二张是web端的解析,第三张是开发者工具这是啥问题?

富文本代码(跟section没关系,我把section替换成div也是不行)

<section style=\"box-sizing: border-box; font-style: normal; font-weight: 400; text-align: justify; font-size: 16px;\"><section style=\"font-size: 18px; color: rgb(136, 136, 136); line-height: 1.75; letter-spacing: 1px; padding: 0px 20px; box-sizing: border-box;\"><p style=\"font-size: 17px; margin: 0px 0px 17px; white-space: normal; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"></strong><span style=\"color: #595959; box-sizing: border-box;\">7月6日,<strong>喜临门公布上半年业绩预增公告</strong>,预计21H1实现营业收入30.5-31.1亿元,同比+54.4%-57.4%;归母净利润2.15-2.2亿元,同比+406.0%-417.8%;<strong>扣非归母净利润1.75-1.8亿元,同比+414.4%-429.1%</strong>。</span></p><p style=\"font-size: 17px; margin: 0px 0px 17px; white-space: normal; padding: 0px; box-sizing: border-box;\"><span style=\"color: #595959; box-sizing: border-box;\">据天风证券分析,<strong>公</strong><strong>司自主品牌线上线下全面快速发展,市场份额稳步提升</strong>。</span></p><p style=\"font-size: 17px; margin: 0px 0px 17px; white-space: normal; padding: 0px; box-sizing: border-box;\"><strong><span style=\"color: #595959; box-sizing: border-box;\">线下零售端:</span></strong><span style=\"color: #595959; box-sizing: border-box;\">经销网络持续加密,截至2020年,公司共拥有3643家门店,其中喜临门、喜眠、M&amp;D、夏图门店数量分别为2340/800/450/53家,20年合计净增加门店643家,同时在全国88个城市引入建材头部品牌的实力大商,优化经销商团队。</span></p><p style=\"font-size: 17px; margin: 0px 0px 17px; white-space: normal; padding: 0px; box-sizing: border-box;\"><strong><span style=\"color: #595959; box-sizing: border-box;\">线上零售端:</span></strong><span style=\"color: #595959; box-sizing: border-box;\">天猫、京东、苏宁等多个平台同步发力,销售规模持续提升。618全网总销量3.62亿元,同比增长145%,其中全网软床总计销量5576万,同比增长179%。</span></p><p style=\"font-size: 17px; margin: 0px 0px 17px; white-space: normal; padding: 0px; box-sizing: border-box;\"><span style=\"color: #595959; box-sizing: border-box;\">此外,<strong>公司床垫产品优势显著,软床、沙发业务不断完善。</strong></span></p><p style=\"font-size: 17px; margin: 0px 0px 17px; white-space: normal; padding: 0px; box-sizing: border-box;\"><span style=\"color: #595959; box-sizing: border-box;\">产品端持续加大投入,保持床垫领域的领先优势,并持续推动软床、沙发业务的发展。</span><strong><span style=\"color: #595959;\">顺应消费者一站式购物需求</span></strong><span style=\"color: #595959;\">,公司可以鼓励优质经销商开展多品类、套系化销售,发挥多品类的协同效应,从而带动客单价提升、增厚公司整体收入。&nbsp;</span></p><p style=\"font-size: 17px; white-space: normal; margin: 0px; padding: 0px; box-sizing: border-box;\">来源:天风证券</p></section><section style=\"max-width: 100%; position: static; box-sizing: border-box;\"><section style=\"padding-right: 8px; padding-left: 8px; white-space: normal; font-family: &quot;Helvetica Neue&quot;; box-sizing: border-box; letter-spacing: 1px; line-height: 1.9; font-size: 15px; overflow: hidden; text-align: center; max-width: 100%;\"><section></section></section></section><section style=\"max-width: 100%; position: static; box-sizing: border-box;\"><section style=\"padding-right: 8px; padding-left: 8px; white-space: normal; font-family: &quot;Helvetica Neue&quot;; box-sizing: border-box; letter-spacing: 1px; line-height: 1.9; font-size: 15px; overflow: hidden; text-align: center; max-width: 100%;\"><section></section></section></section><section style=\"max-width: 100%; position: static; box-sizing: border-box;\"><section style=\"white-space: normal; text-align: center; max-width: 100%; box-sizing: border-box;\"><section></section></section></section><section style=\"max-width: 100%; position: static; box-sizing: border-box;\"><section style=\"white-space: normal; max-width: 100%; box-sizing: border-box;\"><section style=\"display: inline; max-width: 100%; box-sizing: border-box;\"><section style=\"max-width: 100%; position: static; box-sizing: border-box;\"><section style=\"color: rgb(136, 136, 136); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; font-size: 15px; letter-spacing: 0.544px; text-align: left; max-width: 100%; box-sizing: border-box;\"><section></section></section></section></section></section></section><section style=\"max-width: 100%; position: static; box-sizing: border-box;\"><section style=\"padding-right: 8px; padding-left: 8px; white-space: normal; font-family: &quot;Helvetica Neue&quot;; box-sizing: border-box; letter-spacing: 1px; line-height: 1.9; font-size: 15px; overflow: hidden; text-align: center; max-width: 100%;\"><section></section></section></section><section style=\"max-width: 100%; position: static; box-sizing: border-box;\"><section style=\"padding-right: 8px; padding-left: 8px; white-space: normal; font-family: &quot;Helvetica Neue&quot;; box-sizing: border-box; letter-spacing: 1px; line-height: 1.9; font-size: 15px; overflow: hidden; text-align: center; max-width: 100%;\"><section></section></section></section><section style=\"text-align: start; padding-right: 8px; padding-left: 8px; white-space: normal; box-sizing: border-box; letter-spacing: 1px; line-height: 1.9; font-size: 15px; overflow: hidden; max-width: 100%;\"><p style=\"margin: 0px; padding: 0px; box-sizing: border-box;\"><br/></p></section></section><p><br/></p>

最后一次编辑于  2021-07-09
回答关注问题邀请回答
收藏

1 个回答

  • 涂之包
    涂之包
    2021-07-09

    不是空格,是换行规则。这是样式问题。

    这些css属性可以去查一下:word-break、word-wrap、white-space

    2021-07-09
    有用
    回复
登录 后发表内容