使css(或其他东西)格式化文本,使其赢得';不要走出去';边界

使css(或其他东西)格式化文本,使其赢得';不要走出去';边界,css,html,Css,Html,我有一个页面,它应该显示内容。但当我有,例如:一个长单词,它走出了边界 <table><tr><td id="contentholder" width="600px" valign="top">......... 。。。。。。。。。 在那里你可以明白我的意思 我需要做什么才能将很长的单词剪切并放入新行?将以下内容添加到#contentholder css中: word-wrap: break-word; 此处更新了JSFIDLE-代码: #conten

我有一个页面,它应该显示内容。但当我有,例如:一个长单词,它走出了边界

<table><tr><td id="contentholder" width="600px" valign="top">.........
。。。。。。。。。
在那里你可以明白我的意思


我需要做什么才能将很长的单词剪切并放入新行?

将以下内容添加到#contentholder css中:

word-wrap: break-word;
此处更新了JSFIDLE-

代码:

#contentholder{
    max-width:600px;
    word-wrap:break-word;
}
和运行:

在CSS中

#contentholder{
    max-width:600px;
    word-wrap:break-word;
}

像这样

#contentholder{
max-width:600px;
word-wrap: break-word;
}

哈哈,在帖子上比你快了2秒——虽然我显然在保存JSFIDLE上慢了些!但不管怎样,我喜欢你的回答+1@Nick-BriarMoonDesign现在我不知道我必须选择哪一个作为最佳答案…生成一个介于1和3之间的随机数?我想我选择Nick的,因为他得分较少。对不起,玛拉
#contentholder
#contentholder{
max-width:600px;
word-wrap: break-word;
}