http://community.csdn.net/Expert/topic/2951/2951747.xml?temp=.4711267
左环绕:<IMG SRC="a.GIF" style="float:left">
右环绕:<IMG SRC="a.GIF' style="float:right">
style="float:right;clear:left"尝试 
float : none | left |right 
 
参数: 
 
none :  对象不浮动
left :  对象浮在左边
right :  对象浮在右边 
clear : none | left |right | both 
 
参数: 
 
none :  允许两边都可以有浮动对象
both :  不允许有浮动对象
left :  不允许左边有浮动对象
right :  不允许右边有浮动对象

解决方案 »

  1.   

    其实在图片和文字上就是一个普通的link,图片文字和图片地址是存在数据库中的,需要的时候取出,下面是一段生成缩略图的function(需要GD支持)
    调用方法:
    makethumb($sourceImg,$destImg,50);//$SourceImg,原图片名称,$destImg,缩略图文件名
    <?php
    function makethumb($srcFile,$dstFile,$dstW) { 
    $data = GetImageSize($srcFile,&$info); 
    switch ($data[2]) { 
    case 1: 
    //$im = ImageCreateFromGIF($srcFile); #if you GD support GIF
    $im = @ImageCreateFromJPEG($srcFile); #if you GD don't support GIF
    break; 
    case 2: 
    $im = @ImageCreateFromJPEG($srcFile); 
    break; 
    case 3: 
    $im = @ImageCreateFromPNG($srcFile); 
    break; 

    $srcW=ImageSX($im); 
    $srcH=ImageSY($im); 
    $dstX=0; 
    $dstY=0;
    $dstH = $data[1]*$dstW/$data[0];
    if ($srcW*$dstH > $srcH*$dstW) { $fdstH=round($srcH*$dstW/$srcW); $dstY=floor(($dstH-$fdstH)/2); $fdstW=$dstW; } 
    else { $fdstW=round($srcW*$dstH/$srcH); $dstX=floor(($dstW-$fdstW)/2); $fdstH=$dstH; } 
    $ni=ImageCreate($dstW,$dstH); 
    $dstX=($dstX < 0)?0:$dstX; 
    $dstY=($dstX < 0)?0:$dstY; 
    $dstX=($dstX > ($dstW/2))?floor($dstW/2):$dstX; 
    $dstY=($dstY > ($dstH/2))?floor($dstH/2):$dstY; 
    $black = ImageColorAllocate($ni, 255,255,255);
    imagefilledrectangle($ni,0,0,$dstW,$dstH,$black); 
    ImageCopyResized($ni,$im,$dstX,$dstY,0,0,$fdstW,$fdstH,$srcW,$srcH); 
    ImageJpeg($ni,$dstFile);
    imagedestroy($im); 
    imagedestroy($ni); 
    }
    ?>
      

  2.   

    [楼主]screend很踊跃呀,你都参与我三个提问了。谢谢。大家继续。
      

  3.   

    缩略图,看http://mm.it800.biz,就是用了这个技术(初始上传图片都是500*500的),如果你需要可以发一份代码给你。
      

  4.   

    to pwtitle(doodoo) 
    我需要能发一份给我嘛?邮箱:[email protected]。谢谢了!
      

  5.   

    建议你用ImageMagick来代替GD生成缩略图,不仅没有gif文件的限制,而且调用命令行来生成的方式比gd的函数使用来说简单很多。
    它有win32和linux版,linux下你只要装一个rpm包就可以用了。
    coppermine这个照片管理系统就是两种可选的缩图生成。可以参考
    有何问题联系我[email protected]
      

  6.   

    如果是图文混排的话。不考虑客户端的浏览器兼容性的话,最好的fckeditor,你拿来后自己要作些改动,主要是把UTF-8的页面换成GB2312,不然输入文字保存后显示的时候容易有问题。
      

  7.   

    <%
     int iTotalByte,iTotalRead,iReadByte;
     iTotalByte=request.getContentLength(); 
     iTotalRead=0;
     iReadByte=0;
     byte[] Buffer=new byte[iTotalByte];
     if(iTotalByte>0)
     {
      for(;iTotalRead<iTotalByte;iTotalRead+=iReadByte)
      {
       try
       {
    iReadByte=request.getInputStream().read(Buffer,iTotalRead,iTotalByte-iTotalRead);
       }
       catch(Exception e)
       {
        e.printStackTrace();
       }
      }
      String strContentType=request.getContentType();
      //数据处理开始
      String strBuffer=new String(Buffer);
      %><!--<br>表单数据:<br>strBuffer<br>--><%
      String strBoundary="--"+strContentType.substring(strContentType.lastIndexOf("=")+1,strContentType.length());
      String strArray[]=strBuffer.split(strBoundary);  String strSubString;
      int iBegin,iEnd;
      iBegin=0;iEnd=0;
      String strFieldName="";
      String strFieldValue="";
      String strFilePath="";
      String strFileName="";
      String strFileType="";
      boolean bTrue;
      bTrue=false;
      int iLocation=0;
      for(int iIndex=1;iIndex<strArray.length-1;iIndex++)
      {
       strSubString=strArray[iIndex];
       iBegin=strSubString.indexOf("name=\"",0);
       if(iBegin!=-1)
       {
        strFieldName="";strFieldValue="";
        strFilePath="";strFileName="";strFileType="";
        iEnd=strSubString.indexOf("\"",iBegin+6);
        strFieldName=strSubString.substring(iBegin+6,iEnd);
        iBegin=strSubString.indexOf("filename=\"",0);        if(iBegin!=-1)
        {
         bTrue=true;
        }
        iEnd=strSubString.indexOf("\r\n\r\n",0);
        if(bTrue==true)
        {
         //文件路径
         strFilePath=strSubString.substring(iBegin+10,strSubString.indexOf("\"",iBegin+10));strFileName=strFilePath.substring(strFilePath.lastIndexOf("\\")+1);
         strFileType=strSubString.substring(strSubString.indexOf("Content-Type: ")+14,strSubString.indexOf("\r\n\r\n"));
         %><!--<br>文件类型:<br>strFileType<br>--><%
         //文件数据
         iBegin=strSubString.indexOf("\r\n\r\n",iBegin);
         strFieldValue=strSubString.substring(iBegin+4);
         strFieldValue=strFieldValue.substring(0,strFieldValue.lastIndexOf("\n")-1);
         %><!--<br>文件路径:<br>strFilePath<br>文件名称:<br>strFileName<br>--><%
         byte[] pFile=strFieldValue.getBytes();
         byte[] pFileExtend=new byte[pFile.length];
         iLocation=strBuffer.indexOf("filename=\"",iLocation);
         for(int kIndex=iLocation;kIndex<iTotalByte-2;kIndex++)
         {
          if(Buffer[kIndex]==13&&Buffer[kIndex+2]==13)
          {iLocation=kIndex+4;break;}
         }
         for(int nIndex=0;nIndex<pFile.length;nIndex++)
         {
          pFileExtend[nIndex]=Buffer[iLocation+nIndex];
         }
    /*
    //保存到Local Disk;
    FileOutputStream pFileOutputStream=new FileOutputStream("F:\\Site_App\\UploadFile\\"+strFileName);
    pFileOutputStream.write(pFileExtend);
    pFileOutputStream.close();
    */
         session.putValue(strFieldName+"_FileType",strFileType);
         session.putValue(strFieldName+"_FilePath",strFilePath);
         session.putValue(strFieldName+"_FileName",strFileName);
         session.putValue(strFieldName,pFileExtend);
        }
        else
        {
         strFieldValue=strSubString.substring(iEnd+4);
         strFieldValue=strFieldValue.substring(0,strFieldValue.lastIndexOf("\n")-1);
    session.putValue(strFieldName,strFieldValue);
        }
        bTrue=false;
       }
       %><!--<br>表单域名:<br>strFieldName<br>表单域值:<br>strFieldValue<br>--><%
      }
      //数据处理结束
     }
    %>