代码
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="static/library/bootstrap/5.1.3/css/bootstrap.min.css">
<script type="text/javascript" src="static/library/bootstrap/5.1.3/js/bootstrap.min.js"></script>
</head>
<body>
<style type="text/css">
#d1,
#d2 {
overflow: scroll;
width: 300px;
border: 1px solid red;
}
/* pre,
code {
unicode-bidi: normal !important;
} */
</style>
<div id="d1">
d1-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
</div>
<div id="d2">
<pre>
<code>d2-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</code>
</pre>
</div>
</body>
</html>
在pc段呈现正常, 可以横向滚动
以下是手机端呈现, 自动换行了, 不能横向滚动
确定是引入了bootstrap导致的问题, 如果去除框架的依赖后可以正常的横线滚动
如何解决这个问题? 如果需要用bootstrap并且手机端pre,code支持横向滚动