WordPress文章内容不能自动换行的解决方法

最近有朋友问倡萌,WordPress文章内容不能自动换行该怎么办。其实这样的问题,比较常见于一连串较长的英文字符,比如有些人粘贴的某个 电驴链接 或 迅雷链接 等。

解决方法

只要给包含文章内容的 id 或 class 选择器添加下面的css代码即可。

#content .post{width:640px;white-space:normal;word-break:break-all;word-wrap:break-word;overflow:hidden;}

注:上面的 #content .post 要根据自己的实际修改。

相关属性讲解

white-space : http://www.w3school.com.cn/css/pr_text_white-space.asp

word-break : http://doc.51windows.net/css2/?url=/css2/css2/c_wordbreak.html

word-wrap : http://doc.51windows.net/css2/?url=/css2/css2/c_wordbreak.html

overflow : http://www.w3school.com.cn/css/pr_pos_overflow.asp

来源:

https://www.wpdaxue.com/wordpress-word-wrap.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32835.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?