CSS wrapping text box to multiple images

故事扮演 提交于 2019-12-11 01:19:13

问题


I have been stuck the last couple of hours trying to wrap my text box against multiple images, as seen on this picture:

Is it even possible without using a js library?

Also, the solution has to work in everything from IE6 to today's browsers, without js.


回答1:


The two ways I can think off would be two split the image into two and use float:right and text-align to get the text to 'follow' the image or use the multi-div hack outlined here: http://www.ideashower.com/ideas/active/css-text-wrapper/ .

But there's nothing particularly neat without using javascript.




回答2:


It is:

this is a class:
    .alignLeft {
      float:left; 
      margin-right: 1em; 
  }    
    .alignRight { 
     float:right;
     margin-left: 1em;
    }


 and the image calls it:



 <img src="photo.jpg" class="alignLeft" />


来源:https://stackoverflow.com/questions/8186618/css-wrapping-text-box-to-multiple-images

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