CSS将文本框包装到多个图像

时间:2022-10-17 22:17:28

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

在最后几个小时我试图将文本框包装在多张图片上,如图所示:

CSS将文本框包装到多个图像

Is it even possible without using a js library?

是否可以不使用js库?

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

此外,该解决方案必须适用于从IE6到今天的浏览器,没有js。

2 个解决方案

#1


0  

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/ .

我可以想到的两种方法是将图像分成两部分并使用float:right和text-align来使文本“跟随”图像或使用此处概述的多部分黑客:http:// www。 ideashower.com/ideas/active/css-text-wrapper/。

But there's nothing particularly neat without using javascript.

但是如果不使用javascript,没有什么特别整洁。

#2


0  

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" />

#1


0  

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/ .

我可以想到的两种方法是将图像分成两部分并使用float:right和text-align来使文本“跟随”图像或使用此处概述的多部分黑客:http:// www。 ideashower.com/ideas/active/css-text-wrapper/。

But there's nothing particularly neat without using javascript.

但是如果不使用javascript,没有什么特别整洁。

#2


0  

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" />