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

상품 분류는 정렬을 어떻게 수정을 해야하나요? 채택완료

바라본다 6년 전 조회 4,954

안녕하세요

분류상품을 가운데 정렬하려고 하는데...어디를 어떻게 건드려야 하는지 부탁드립니다.

현재 정렬이 left로 되어 있는데 center로 하려고합니다..ㅠㅠ

혹시나 해서 list.10.skin.php를 수정해보려고 하니 안되더라구요..ㅠㅠ

 

 

아래는 메인 상품 정렬된 모습입니다.

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

답변 4개

채택된 답변
+20 포인트
하틴
6년 전

<ul class="sct sct_10" style="text-align: center;">

<li class="sct_li sct_clear" style="width:230px;display: inline-block; float: none;">

 

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

답변에 대한 댓글 2개

바라본다
6년 전
답변 감사합니다. 근데 말씀해주신 소스를

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
?>

<!-- 상품진열 10 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
if ($this->list_mod >= 2) { // 1줄 이미지 : 2개 이상
if ($i%$this->list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
else if ($i%$this->list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
else $sct_last = '';
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}

if ($i == 1) {
if ($this->css) {
echo "<ul class=\"{$this->css}\">\n";
} else {
echo "<ul class=\"sct sct_10\">\n";
}
}

echo "<li class=\"sct_li {$sct_last}\" style=\"width:{$this->img_width}px\">\n";

echo "<div class=\"sct_img\">\n";

if ($this->href) {
echo "<a href=\"{$this->href}{$row['it_id']}\">\n";
}

if ($this->view_it_img) {
echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";
}

if ($this->href) {
echo "</a>\n";
}


if ($this->view_sns) {
$sns_top = $this->img_height + 10;
$sns_url = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
echo "<div class=\"sct_sns\">";
echo get_sns_share_link('facebook', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/facebook.png');
echo get_sns_share_link('twitter', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/twitter.png');
echo get_sns_share_link('googleplus', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/gplus.png');
echo "</div>\n";
}

echo "</div>\n";

if ($this->view_it_id) {
echo "<div class=\"sct_id\">&lt;".stripslashes($row['it_id'])."&gt;</div>\n";
}

if ($this->href) {
echo "<div class=\"sct_txt\"><a href=\"{$this->href}{$row['it_id']}\">\n";
}

if ($this->view_it_name) {
echo stripslashes($row['it_name'])."\n";
}

if ($this->href) {
echo "</a></div>\n";
}

if ($this->view_it_basic && $row['it_basic']) {
echo "<div class=\"sct_basic\">".stripslashes($row['it_basic'])."</div>\n";
}

if ($this->view_it_cust_price || $this->view_it_price) {

echo "<div class=\"sct_cost\">\n";

if ($this->view_it_cust_price && $row['it_cust_price']) {
echo "<span class=\"sct_discount\">".display_price($row['it_cust_price'])."</span>\n";
}

if ($this->view_it_price) {
echo display_price(get_price($row), $row['it_tel_inq'])."\n";
}

echo "</div>\n";

}

if ($this->view_it_icon) {
echo "<div class=\"sct_icon\">".item_icon($row)."</div>\n";
}



echo "</li>\n";
}

if ($i > 1) echo "</ul>\n";

if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>
<!-- } 상품진열 10 끝 -->
이 위에 넣어 봤는데 그대로네요.ㅠㅠ
하틴
6년 전
으잉? 안넣으셨는데요? 상품의 ul 과 li에

ul스타일 추가 text-align: center;
li스타일 추가 width:230px;display: inline-block; float: none;

해주셔야해요!

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

네 답변 감사합니다. 

말씀하신대로 한번 수정해보겠습니다.

친절한 답변 감사드립니다

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

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

말씀해주신 소스를 어디에 어떻게 넣어야 할지 모르겠습니다...php를 아예 몰라서.ㅠㅠ 자세한 설명 부탁드립니다.ㅠㅠ

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

답변에 대한 댓글 1개

하틴
6년 전
음..php안에 html 소스중에 calss 명이 똑같은게 있습니다 거기에 넣어주시면되는데

일단 되는지모르겠지만 넣어드렸습니다

[code]
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
?>

<!-- 상품진열 10 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
if ($this->list_mod >= 2) { // 1줄 이미지 : 2개 이상
if ($i%$this->list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
else if ($i%$this->list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
else $sct_last = '';
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}

if ($i == 1) {
if ($this->css) {
echo "<ul class=\"{$this->css}\">\n";
} else {
echo "<ul class=\"sct sct_10\" style=\"text-align: center;\">\n";
}
}

echo "<li class=\"sct_li {$sct_last}\" style=\"width:{$this->img_width}px;display: inline-block; float: none;\">\n";

echo "<div class=\"sct_img\">\n";

if ($this->href) {
echo "<a href=\"{$this->href}{$row['it_id']}\">\n";
}

if ($this->view_it_img) {
echo get_it_image($row['it_id'], $this->img_width, $this->img_height, '', '', stripslashes($row['it_name']))."\n";
}

if ($this->href) {
echo "</a>\n";
}


if ($this->view_sns) {
$sns_top = $this->img_height + 10;
$sns_url = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
echo "<div class=\"sct_sns\">";
echo get_sns_share_link('facebook', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/facebook.png');
echo get_sns_share_link('twitter', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/twitter.png');
echo get_sns_share_link('googleplus', $sns_url, $sns_title, G5_SHOP_SKIN_URL.'/img/gplus.png');
echo "</div>\n";
}

echo "</div>\n";

if ($this->view_it_id) {
echo "<div class=\"sct_id\">&lt;".stripslashes($row['it_id'])."&gt;</div>\n";
}

if ($this->href) {
echo "<div class=\"sct_txt\"><a href=\"{$this->href}{$row['it_id']}\">\n";
}

if ($this->view_it_name) {
echo stripslashes($row['it_name'])."\n";
}

if ($this->href) {
echo "</a></div>\n";
}

if ($this->view_it_basic && $row['it_basic']) {
echo "<div class=\"sct_basic\">".stripslashes($row['it_basic'])."</div>\n";
}

if ($this->view_it_cust_price || $this->view_it_price) {

echo "<div class=\"sct_cost\">\n";

if ($this->view_it_cust_price && $row['it_cust_price']) {
echo "<span class=\"sct_discount\">".display_price($row['it_cust_price'])."</span>\n";
}

if ($this->view_it_price) {
echo display_price(get_price($row), $row['it_tel_inq'])."\n";
}

echo "</div>\n";

}

if ($this->view_it_icon) {
echo "<div class=\"sct_icon\">".item_icon($row)."</div>\n";
}



echo "</li>\n";
}

if ($i > 1) echo "</ul>\n";

if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n";
?>
<!-- } 상품진열 10 끝 -->
[/code]

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

하틴
6년 전

음..저는 가운데 정렬을할때 해당 부분에 padding 값이나 text-align:center; 이나 margin:auto; 를 하곤합니다.

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

답변에 대한 댓글 2개

바라본다
6년 전
감사합니다 근데 저건 list.10.skin.php에 저도 그렇게 넣어서 했는데 움직이지가 않더군요....
하틴
6년 전
상품 보여주는 ul에 (class가 sct sct_10네요) display: inline-block; 스타일을 추가하시고

상품 보여주는 li에(class 가 sct_li sct_clear 네요) 다가 display: inline-block; 스타일 추가 해주시고

해당 li의 float:left를 지워주면 가운데 정렬되네요!

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

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

로그인