Honestly, I think some users use it who don't need to - in particular one author who wrote very long lines that would break the now-shared page. So I figured there might be a way of getting most of the benefits of a <pre> tag but still breaking super-long lines, and sure enough stackoverflow had the answer:
pre {
white-space: pre-wrap; /* CSS3 */
white-space: -moz-pre-wrap; /* Mozilla, post millennium */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
Stackoverflow has so many answers - in many cases, the problem is just knowing the question. I think this is true in general, for languages you're not using every day, it's ok just to know the concepts, and make good guesses as to what commands are likely available already. Sometimes it seems embarrassing how I write all my personal sites in PHP (as I've said before, not as dumb as it sounds) but how few commands there are that I don't end up looking up. (Then again, I had my own cheatsheet for tropes in Perl...)
No comments:
Post a Comment