Skip to content

Instantly share code, notes, and snippets.

@xiaoda
Created February 28, 2016 15:00
Show Gist options
  • Save xiaoda/8e31f01ba3035ad108fe to your computer and use it in GitHub Desktop.
Save xiaoda/8e31f01ba3035ad108fe to your computer and use it in GitHub Desktop.
css实现强制不换行/自动换行/强制换行
/* 强制不换行 */
div{
white-space: nowrap;
}
/* 自动换行 */
div{
word-wrap: break-word;
word-break: normal;
}
/* 强制英文单词断行 */
div{
word-break:break-all;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment