테스트 사이트 - 개발 중인 베타 버전입니다

이미지 두개씩 나오게 하려면 채택완료

연탄집개 4년 전 조회 1,795

아래 소스는 이미지가 하나씩 출력되는데 

한줄에 두개의 이미지가 출력되도록 하고 싶은데 어디를 수정해야 할지요 ?

ㅠㅠ

</p>

<p> <div class="container">

    <div id="slides">

      <?php

        for ($i=0; $i<count($list); $i++) {

          //썸네일 생성

          $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $imgwidth, $imgheight);

          if($thumb['src']) {

            $img_content = '<img class="img_left" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';

          } else {

            $img_content = 'NO IMAGE';

          }

 

          if ($list[$i][wr_link1]) {

            if ($list[$i][wr_link2] == "none") {

              echo "{$img_content}";

            } elseif ($list[$i][wr_link2] == "_blank") {

              echo "<a href='{$list[$i][wr_link1]}' target='_blank'>{$img_content}</a>";

            } elseif ($list[$i][wr_link2] == "_self") {

              echo "<a href='{$list[$i][wr_link1]}'>{$img_content}</a>";

            } else {

              if ($list[$i][wr_link1]) { 

                echo "<a href='{$list[$i][wr_link1]}' target='_blank'>{$img_content}</a>";

              } else { 

                echo "<a href='{$list[$i][href]}'>{$img_content}</a>";

              }

            }

          } else {

            echo "{$img_content}";

          }

        }</p>

<p>        if (count($list) == 0) { 

          echo "<center><font color=#6A6A6A>새소식이 없습니다.</font></center>";

        } 

      ?>

    </div>

  </div></p>

<p>

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
4년 전

1) if($thumb['src']) {
            $img_content = '<img class="img_left" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
          }

->

if($thumb['src']) {
            $img_content = '<div><img class="img_left" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'"></div>';
          }

 

2) 

</div>
  </div>

->

</div>
  </div>

 

<style>

.container .slides div {

  float:left;

  width:47%;

}

.container .slides div:nth-child(2n+1) {
    clear: both;
}

</style>

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인