Wrapping Text Inside Pr Tags


もっと読む
http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/
sometimes display little snippets of code on this site.For example,here,and here.To do this,I use the Code Markp wodpress plugin.
If you’re using Firefox,you may notice the long lineas in my Digg Integrator fix post.It’s not really a problem for me having those really long lineas in Firefox.Why?Because Firefox still displays my sidebar corectly.Internet Explorer is a totally different story though.When there’s long line s like that,my sidebar will appart the very bottom of the page IE.
The long lineas.caused by use of the pre.The pre.The pre pre.spaces and line breaks in a chunk of text.Perfect for displaying snippets of code.However,some lints of code the corese quite long and and will the atfarge e e Thext the
So,I set out looking for a method to wrap text contained within pre tags.Google found exactly what I was looking for.Wrapping text inside pre tags is quite ease,all that’s required is a simpadle diurtion。
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+ */
}
After adding that CSS、the text in pre tags still doesn't wrap in Firefox、but I don't care because Firefox displays the ret of my page asitshuld.Now、when view theeew a papaage e e e e e e e e e e e e e e e e e e e e e e thethethethetheaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaatttte e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e thethethethethethethethethettom.
For consistency sake,let’s make these long lineas wrap in Firefox too.This is extremiely simple.It only requires adding a few characters to the CSS shown above.For text wrapping Firefox,use CSS:CSS:

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+ */
}
Notice the only difference between the first and second example s is the addition of“!importent”to the third line in example 2.After adding that little bit,your text between your pre tags shar.ore Tags shabrect
If you can’t seem to get the css above to work,give the css below a shot.I just set a width on the pre(.When the width is set to 100%,you'll ll get a horizontal scrollbar when view ining IE 7.Thatwith the 6.Thew.Thew.Thew.Thew.Thew.Thew。and FireFox when width is set to 99%.I have not tested Opera.Try this udated CSS if you’re having iss with theオリジナリティCSS from above.

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%;
}
Market Laine posted some css in a comment that seems to work better than the orriginal css I posted.I t work s in IE,Safari,and FireFox.Try using Mark’s s beloiful the prexamples don’work for you.

pre {
 overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
 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 */
 /* width: 99%; */
 word-wrap: break-word; /* Internet Explorer 5.5+ */
}
Centification exams from cisco like 350-001 and 640-802、also from the other vent dors like Microsoft having simillar exams 70-290 and 70-219 along with lesser known Vmware VCP-310 can help brom brom。