tags:

views:

58

answers:

2

Hey guys,

I have a preview box much like the one stackoverflow uses, for submitting material that updates in real time. The problem is that a really long word hangs on the outside. Does stackoverflow use a jquery plugin to wrap long words in the preview box or a css rule?

+2  A: 

StackOverflow uses WMD (blog article on the reverse engineering effort), which includes the preview. The code for it is freely available on Google Code. Even if you don't want to use the editor you could look at the code to see how it is done.

tvanfosson
so this basically changes default css rules and form behavior, and modifies them with one set of behavior?
Scarface
+2  A: 

It's just CSS:

#wmd-preview p {
    word-wrap: break-word;
}
J-P
why was javascript used to invoke the rules then? Why not just create one large css doc?
Scarface
This CSS instruction is as magic as is Supercalifragilisticexpialidoceous, especially for WCAG2 and its requirement of a 200% zoom text.
Felipe Alsacreations