查看: 753|回复: 0

ueditor编辑器前台html代码宽度不随页面自适应

[复制链接]

748

主题

39

回帖

3907

积分

管理员

总舵主

积分
3907
QQ
发表于 2024-5-25 19:41:03 | 显示全部楼层 |阅读模式
将dedecms更换为ueditor编辑器后发现在后台插入html代码后前台显示代码区域的宽度超过网页设定的宽度,如下图:

这是因为在前台引用的代码高亮CSS内缺少一个样式,查找include/ueditor/third-party/SyntaxHighlighter,找到shCoreDefault.css文件打开,找到下方代码:
  1. .syntaxhighlighter{width:100%!important;margin:.3em 0 .3em 0!important;position:relative!important;overflow:auto!important;background-color:#f5f5f5!important;border:1px solid #ccc!important;border-radius:4px!important;border-collapse:separate!important}
复制代码
将width:100%!important样式去掉,添加如下样式:
  1. word-break:break-all!important;
复制代码
这样就可以了,调整后如下图显示:




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
道不同,不相为谋!理想要有,万一实现了呢?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:2513533699@qq.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|鲁ICP备19000917号|鲁公网安备37078302000320号

在本版发帖
关注公众号
QQ客服返回顶部