Wrapping Long URLs and Text Content with CSS
Jun 1, 2010 CSS, General, HTML, JavaScript, Wordpress
To wrap long URL s, strings of text, and other content, just apply this carefully crafted chunk of CSS code to any block-level element (e.g., perfect for <pre> tags): pre { white-space: pre; /* CSS 2.0 */ white-space: pre-wrap; /* CSS 2.1 */ white-space: pre-line; /* CSS 3.0 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: -moz-pre-wrap; /* Mozilla */ white-space: -hp-pre-wrap; /* HP Printers */ word-wrap: break-word; /* IE 5+ */ } See demonstration Explanation By default, the white-space property is set to normal . So you might see something like this when trying to force long URL s and other continuous strings of text to wrap: To force long, continuous strings of text to wrap within the width of our <pre> content (or other block-level element, such as <div> and <p> ), we need a different value for the white-space property. Here are our options: normal – Default value for the white-space property.
Buy & Sell Flash Files – Flash Marketplace
Tags: CSS, forbidden, forbidden-forbidden, JavaScript, presentation, server, Tips, tricks, while-trying







Leave a Reply