이미지 두개씩 나오게 하려면

이미지 두개씩 나오게 하려면

QA

이미지 두개씩 나오게 하려면

본문

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

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

ㅠㅠ


 <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}";
          }
        }
        if (count($list) == 0) { 
          echo "<center><font color=#6A6A6A>새소식이 없습니다.</font></center>";
        } 
      ?>
    </div>
  </div>

이 질문에 댓글 쓰기 :

답변 1

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>

답변을 작성하시기 전에 로그인 해주세요.
전체 22
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT