小编Man*_*nas的帖子

css自动换行:break-word无效

我有两个内联跨度.代码示例:

    <div class="comment_content">

        <span class="comment_author"><?= $child_comment['comment_author'] ?></span>
        <span class="comment_text"><?= $child_comment['comment_content'] ?></span>

    </div>
Run Code Online (Sandbox Code Playgroud)

和scss样本:

.comment_content {        
    word-wrap: break-word;
}
.comment_author {
    display: inline-block;
    vertical-align:top;
}
.comment_text {            
    display: inline-block;
    word-wrap: break-word;
    width: 100%;
}
Run Code Online (Sandbox Code Playgroud)

如果我的预期观点必须是: 预期结果

如果用户输入不带空格的字符串,则字符串不会中断.打破设计:问题

如何正确打破长话?

html css

9
推荐指数
3
解决办法
1万
查看次数

标签 统计

css ×1

html ×1