Tag Archive for wrap

CSS Cross Browser Word Wrap

.word_wrap
{
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* 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+ */
}

source

php word wrap function

$text = "A very long woooooooooooord.";
$newtext = wordwrap($text, 8, "
", true);

echo "$newtext
";

source

wrap your livebookmarks

#bookmarksBarContent { display: block !important; overflow: visible;}
#bookmarksBarContent toolbarseparator { display: inline !important; }
#bookmarksBarContent .bookmark-item { visibility: visible !important; }

.places-toolbar-items { display: block !important; height: 33px !important; overflow-y: auto !important; }
.chevron { display: none !important; }

source

Text Wrapping with Regular Expressions

def wrap_text(txt, col = 80)
txt.gsub(/(.{1,#{col}})( +|$)
?|(.{#{col}})/,
"13
")
end

source

Wrap Long Lines with PRE 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+ */
}

source

word wrap

string wordwrap ( string $str [, int $width [, string $break [, bool $cut]]] )

Here, I use <br> to break the string $string every 20 chars.
i.e.wordwrap($string,20, "<br />
")

source

word wrap pre

/* Browser specific (not valid) styles to make preformatted text wrap */

pre {
white-space: pre-wrap;       /* css-3 */
white-space: -moz-pre-wrap;  /* 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+ */
}

source

Indent text after line wrap

<style type="text/css">
ul {
width: 20em;
}
li {
padding-left: 2em;
text-indent: -2em;
}
</style>
<
<ul>
<li>If we shadows have offended, think but this, and all is mended. That you have but slumbered here, while these visions did appear, and this weak and idle theme, no more yielding but a dream. Gentles, do not reprehend. If you pardon, we will mend. Else the Puck a liar call. And so good night unto you all. Give me your hands, if we be friends, and Robin shall restore amends</li>
</ul>

source

Wrap Text

def wrap_text(txt, col = 80)
txt.gsub(/(.{1,#{col}})( +|$
?)|(.{1,#{col}})/, "13
")
end

source