초보질문좀 드립니다.

초보질문좀 드립니다.

QA

초보질문좀 드립니다.

답변 3

본문

초보질문좀 드립니다
메인화면에 동영상썸네일이 출력이되는데요 동영상썸네일 이미지가 간격이붙어있고 테두리 생겨서 그걸해결하려고 합니다.
고수님들 답변좀 주세요 "감하합니다"

이 질문에 댓글 쓰기 :

답변 3

소스를 올리세요 ㅎㅎ
아니면 이미지간 margin 을 주시던가 테이블이나 div의 간격을 주시는것도

스타일을 주는거는 알겠는데요 일반이미지 스타일적용하는거 하고 동영상이미지하고 좀틀린가바요 어제 시도해보았는데
안되드라구여 그리고 스타일소스를 어느위치에 붙여넣어야 되는지 모르겠더라구여
보통일반 이미지 테두리 없에는거는 border="0" 간격은 padding="10px" 이런식으로 스타일 적용하면 되는걸로 알거든여

히어님 방금회사에서 술한잔하고 방금왔어요 소스올릴게요 봐주세요 ㅎㅎ
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$cols  = 4; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=250; //표시할 이미지의 가로사이즈
$imgheight=300; //표시할 이미지의 세로사이즈
$image_h  = 0; // 이미지 상하 간격

$col_width = (int)(100 / $cols);

$data_path = $g4[path]."/data/file/$bo_table";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="F5F5F5">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100" align="center" bgcolor="red"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><font color="white">전체보기</font></td>
  <td height="35" style="padding-left:10px;"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><b><?=$board[bo_subject]?></b></a></td>
  <td width="30" height="35" align="center" valign="middle"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>">
  <img src="<?=$latest_skin_path?>/img/btn_more.gif" alt="전체보기" border="0" title="전체보기" /></a></td>
</tr>
      </table>
</td>
  </tr>
  <tr>
    <td height="0"><!--여백--></td>
  </tr>
  <tr>
    <td align="center" valign="top">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
<? for ($i=0; $i<count($list); $i++) {
  if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>  
<td width="<?=$col_width?>%" align="center" valign="top" style="padding-top:10px;">
<?

if (preg_match("@<embed.*src=\"//www.youtube.com/v/([^&]+)&?@",$list[$i][wr_content])) {
preg_match("/<embed.*?src=[\"']\/\/www\.youtube\.com\/v\/([^?]+)\?(.*?)['\"]/", $list[$i][wr_content], $matches);
$v = $matches[1];
$thumb_file="<img src='http://img.youtube.com/vi/".$v."/hqdefault.jpg' width='{$imgwidth}' height='{$imgheight}' align='absmiddle'>";
}else{
$thumb_file = "<img src='".$g4[path]."/img/noimage.png' width='{$imgwidth}' height='{$imgheight}' align='absmiddle'>";
}



$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력

echo $list[$i][icon_reply] . " ";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><td valign='top' align='center'><a href='{$list[$i]['wr_link1']}'target='_blank'>".$thumb_file."</a></td></tr>";

echo "<tr><td align='center' height='17'><a href='{$list[$i]['href']}'><span style='font-size:9pt;'><b>{$list[$i]['subject']}</b></span></a></td></tr>";
echo "</table>";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%></td>";
}
?>
<? if (count($list) == 0) { echo "<td align=center>게시물이 없습니다.</td>"; } ?>
  </tr>
</table>
</td>
  </tr>
</table>

if (preg_match("@<embed.*src=\"//www.youtube.com/v/([^&]+)&?@",$list[$i][wr_content])) {
preg_match("/<embed.*?src=[\"']\/\/www\.youtube\.com\/v\/([^?]+)\?(.*?)['\"]/", $list[$i][wr_content], $matches);
$v = $matches[1];
$thumb_file="<img src='".$v."/hqdefault.jpg' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' style='margin:0 10px;'>";
}else{
$thumb_file = "<img src='".$g4[path]."/img/noimage.png' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' style='margin:0 10px;'>";
}
style에서 이미지 좌우 마진을 줘보세요.
첫번째 0은 상하 마진값 두번째 10px라는건 좌우 마진값
글구 아래 빨간건 지우세요.........


   $image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 204
© SIRSOFT
현재 페이지 제일 처음으로