CSS强制换行与强制不换行

  作者:会飞的

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style>

#layout { width:300px; height:200px; margin:0 auto; background:#ddd;word-break:break-all;}

#layout a {word-break:keep-all;white-space:nowrap;}

</style>

</head>

<body>

<div id="layout"><a href="#">这是第一块内容</a> <a href="#">这里第二块内容</a> <a href="#">这是第三块内容</a></div>

</body>

</html>