CSS Hack Wraps Long text in pre HTML tag
Posted: Wed, Mar 9 11:10 AM (PST)Unless the post body / column is big enough, the pre HTML tag will NOT automatically wrapping a long text in a narrow, fix-length post body! However, there is CSS hack for <pre> HTML tag that seems able to really solve all these glitches perfectly!.
How to wrap a long text / code snippet in <pre> HTML tag – a simple way? Wonderful CSS hack that's able to automatically wrap long text in a pair of <pre> HTML tag:
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
width: 99%; /* remove horizontal scroll-bar when viewing in IE7 */
}
Tags:
