html - HTML代码中的自动换行属性问题
问题描述
有谁知道为什么“自动换行”在下面的 html 代码中不起作用?
<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" /><meta name=\"viewport\" content=\"width=341.0px, minimum-scale=1, word-wrap=break-all, maximum-scale=1, user-scalable=no, shrink-to-fit=no\" /></head><body style=\"-webkit-text-size-adjust:none\ ">HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello</body></html>
解决方案
您必须word-wrap: break-word;
在 body 标签中使用 CSS。
<html>
<head>
<meta http-equiv=\ "content-type\" content=\ "text/html; charset=UTF-8\" />
<meta name=\ "viewport\" content=\ "width=341.0px, minimum-scale=1, word-wrap=break-all, maximum-scale=1, user-scalable=no, shrink-to-fit=no\" />
</head>
<body style="word-wrap: break-word; ">HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello</body>
</html>
推荐阅读
- python-3.x - Pandas GroupBy Sum and Plot - 可以同时完成吗?
- regex - 如何使用ansible修改文件但只出现一次
- excel - 将文件从一个工作簿复制到另一个工作簿,但公式指向第一个工作簿
- python - Python 3:组合文件给出“UnicodeDecodeError:'utf-8'编解码器无法解码位置 1 的字节 0x83:无效的起始字节”
- typescript - 如何从 Ionic 3 中的 app.component.ts 中解除 modalCtrl
- python - 如何通过python中的交叉验证生成混淆矩阵?
- python - 如何在 SMALLINT 上使用 teradatasql 在数据库中插入空值,计算期间发生数值溢出
- swift - 来自 myClass 的 NSClassFromString
- javascript - 在其中渲染 svg 内容
- reactjs - 当输入在子组件中时如何在反应中处理表单