我的HTML文本在水平方向垂直
以上是我用文字编写的代码 This one is his
`
<html>
<head>
<style>
#box{
width: 250px;
height: 250px;
border: 2px solid black;
}
</style>
</head>
<body>
<h1>CSS overflow</h1>
<div id="box">
aldskf;jjjjjjjjjjjjjjjjjjjjjjjjjjdaslk;jlaksjdfaslkdjfaslkjlkjlkjkljlk;;sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssfjkaldslgrjlgfjlkgjslkjfsdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddglkjgrrrrrrrrrrrrrrrrrrrrrrrrrrra;oi
</div>
</body>
</html>
答案 0 :(得分:1)
因为他的例子是分隔单词,所以它们会在需要时自动换行,因为只有一串字符,您需要告诉CSS自动换行
将overflow-wrap: break-word
添加到您的CSS here's what it looks like for me
答案 1 :(得分:0)
您可以使用word-wrap: break-word
#box{
word-wrap: break-word
}