how wrap text that does not contain whitespace in HTML button -


i creating html buttons automatically. representative button created in automatic way follows:

<input type="button" value="expected_performance_of_the_atlas_experiment,_vol._3.pdf" onclick="location.href='expected_performance_of_the_atlas_experiment,_vol._3.pdf';"><br> 

the file names , whatnot can become quite long, need implement wrapping of button text. aware of the trick involving use of css property white-space (e.g.

style="width: 600 px;  white-space: normal;" 

), not of great assistance when dealing file names using. there approach feature more detailed delimiting options (perhaps whitespace given highest priority, underscores given next highest priority , on)? there different approach makes more sense? thank ideas may have.

edit: in firefox doesn't work, however, does work if apply <button> element instead of <input type="button"> element.

updated jsfiddle


you might consider using css property word-wrap:break-word;. forces text wrap, regardless of whether has white space or not.

jsfiddle (see edit)

(source)

as far i'm aware, there no css property give priorities different delimiters in text. have achieved somehow javascript.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -