2017-03-16 18 views
-1

我无法在我的CSS模板中找到单词换行。什么可能是没有文字换行的原因?我怎么去解决这个问题呢?在css模板选项中找不到单词换行

+0

你需要很多更具体的。当你说在'CSS **'模板选项中找不到'自动换行'时,你是什么意思?你说的这个模板是什么? –

+0

@MatthewBeckman如果我使用,我可以使用CSS模板提案。我无法找到需要在上面的提案列表中使用的单词换行。是自动换行在我的代码中不起作用的原因。 – shweta

+0

你应该真的链接到你引用的CSS模板。 – Neil

回答

0

您可以在td元素上使用word-wrap。我是猜测您使用的软件等待您输入选项,然后让您从选项中进行选择。

您可以在下方看到工作示例或查看this answer了解更多信息。下面的重要部分是table-layout: fixed以及td元素上的word-wrap

工作实例

td { 
 
    border: 1px solid; 
 
}
<table style="table-layout: fixed; width: 100%"> 
 
    <tr> 
 
    <td style="word-wrap: break-word"> 
 
     LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongWord 
 
    </td> 
 
    <td style="word-wrap: break-word"> 
 
     LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongWord 
 
    </td> 
 
    </tr> 
 
</table>

+0

- 我试过这段代码,但这并没有解决问题。 – shweta

+0

@shweta你将不得不张贴你的代码。制作一个工作示例,并将其附加到您的问题中。 –