Search code examples
htmlcssjquery-mobilephotoswipe

JQuery Mobile word wrap on buttons using photo swipe


I have a series of buttons containing images using the photoswipe plugin for Jquery mobile. Now, I have text in each one of these buttons (which are inside of the .gallery li a), but if the image is too small or the browser is made too narrow, the text simply goes outside of the viewing portion as the button gets smaller. I want to have it so that the text wraps and the button still encapsulates the text regardless. I've tried using white-space:normal and word-wrap:break-word to do this, but to no avail. Is there a way to do this other than having the text added to the image before loading?


Solution

  • use data-inline="true" within the anchor Inline makes the button as wide as the text inside of it needs to be but if you have a paragraph within a button then that may not be your solution it would be best to have a fixed width in that case so it wraps