질문과 답변

2024.11.29 16:36

복사한 위젯과 기존 위젯 분리 적용 방법

8740de0077962138f77988105fdf36cc_1732865513_8412.png


1. 기존 rb.quick_btns

2. 버튼 좌우 배열을 위해 위젯 폴더명 rb.quick_btns2 변경 후 코드 수정

3. rb.quick_btns2에 적용된 좌우배열 코드가 기존 rb.quick_btns에도 영향을 줍니다.


위젯 이름만 달리 하면 디자인도 별도로 적용되는 줄 알았는데 아닌듯 합니다. 기존 위젯과 수정 적용 할 위젯 각각 적용 하는 방법 질문드립니다.


<!--
경로 : /rb/rb.widget/rb.quick_btns/
사용자코드를 입력하세요.
-->
<div class="q_btns_container">
    <!-- 좌측 버튼 그룹 -->
    <div class="q_btns pc">
        <button type="button" class="arr_bg" onclick="location.href='#';">
            <span>레벨링1 가이드</span>
        </button>

        <button type="button" class="arr_bg" onclick="location.href='#';">
            <span>배너광고 신청</span>
        </button>

        <button type="button" class="arr_bg" onclick="location.href='#';">
            <span>포인트 충전</span>
        </button>
    </div>

    <!-- 우측 버튼 그룹 -->
    <div class="q_btns pc">
        <button type="button" class="arr_bg" onclick="location.href='#';">
            <span>레벨링1 가이드</span>
        </button>

        <button type="button" class="arr_bg" onclick="location.href='#';">
            <span>배너광고 신청</span>
        </button>

        <button type="button" class="arr_bg" onclick="location.href='#';">
            <span>포인트 충전</span>
        </button>
    </div>
</div>

<style>
.q_btns_container {
    display: flex;
    gap: 10px;  /* 모든 간격 10px로 통일 */
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;  /* 컨테이너 여백 10px */
}

.q_btns {
    flex: 1;  /* 좌우 균등 분할 */
    display: flex;
    flex-direction: column;
    gap: 10px;  /* 버튼 간 간격 10px */
}

.arr_bg {
    width: 100%;
    padding: 10px;  /* 버튼 내부 여백 10px */
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

@media (max-width: 768px) {
    .q_btns_container {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
    }
   
    .q_btns {
        width: calc(50% - 5px);  /* 정확한 50% 너비 계산 (간격 고려) */
        flex: 0 0 auto;  /* 크기 고정 */
    }
   
    .arr_bg {
        width: 100%;
        justify-content: center;
    }
}
</style>

<script>
function openNewWindow(url) {
    var width = Math.min(window.screen.width, 1380);
    var height = Math.min(window.screen.height, 768);
    var left = (window.screen.width - width) / 2;
    var top = (window.screen.height - height) / 2;
   
    window.open(url, '_blank', `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes`);
}
</script>


  • 공유링크 복사
    미니홈 쪽지 구독하기
    구독하고 알림받기

    댓글목록

    profile_image
    no_profile 우루사100mg미니홈 1:1 대화하기  오래 전

    모듈 가로 폭을 50%로 잡아 두개 넣으면 첨부 이미지 처럼 모바일에서 공간만 차지해서 하나의 박스 안에 배열하려고 합니다.

    2024-11-29 16:48

    profile_image
    리빌더미니홈 1:1 대화하기  오래 전

    하나의 박스에 배열하는 부분은 모듈 1개에 6개의 버튼을 넣는것이 좋아보입니다.

    제가 잘 이해를 한것인지는 모르겠습니다만,
    CSS가 같이 적용되는 부분을 말씀하시는 거면
    class 를 다르게 해서 묶어야 될것같습니다.

    <div class="wd1">
    내용
    </div>

    <div class="wd2">
    내용
    </div>

    <style>
    .wd1 내용 {}
    .wd2 내용 {}
    </style>

    2024-11-29 17:00

    profile_image
    no_profile 우루사100mg미니홈 1:1 대화하기  오래 전

    네 명확하게 답변 주셔서 완벽해결! 원하던데 하나의 박스안에 이쁘게 배열이였습니다.^^ 덕분에 해결되서 감사드립니다.

    2024-11-29 17:21

    profile_image
    리빌더미니홈 1:1 대화하기  오래 전

    해결되셨다니 다행입니다.
    회신 고맙습니다.
    편안한 하루 되세요.

    2024-11-29 17:27