flow text around a transparent png with css/jquery/anything

删除回忆录丶 提交于 2019-12-01 11:33:22

The only conceivable way I could think of for wrapping text around images without hardcoding anything is to enlist the help of jQuery. There is a plugin called jQSlickWrap - it might be the solution that you're looking for. However, it does require HTML5 support on the browser's behalf, so it will not work for IE users as of yet.

The "right" way to do this is CSS3 Shapes / Exclusions (shape-outside/inside, etc.).

Unfortunately as of April 2013 these have not yet been widely implemented. Chrome/Webkit has a test in its canary builds. Perhaps Mozilla will follow on.

Any automatic breaking point detection would involve very complex edge detection, text-metrics and flow computation which are TOO complicated for little gain.

The only feasible way that comes to my mind is to manually approximate the image with a few floating boxes (DIVs) that overlay the image (using HTML+CSS).

This is definitely possible. You just need to create blank elements with a height equal to the line-height of text and the width of where you want the text to break. Then float these elements in your text, with a clear: both CSS style and have your image be absolutely positioned with a z-index under the text.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!