الگو:کانتینر عکس و متن/امامی: تفاوت میان نسخه‌ها

esfandiari>Javid
بدون خلاصۀ ویرایش
esfandiari>Javid
بدون خلاصۀ ویرایش
خط ۱: خط ۱:
<html>
 
<html lang="fa" dir="rtl">
<head>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
 
@media (max-width: 768px) {
    <style>
  .main-wrap {
        /* =========================================================
    padding: 12px !important;
          تنظیمات عنوان
    margin: 10px auto !important;
        ========================================================= */
  }
 
        .page-title {
            text-align: center;
            font-size: 48px;
            margin: 15px 0;
            line-height: 1.6;
           
        }
 
 
        /* =========================================================
          کانتینر اصلی
        ========================================================= */
 
        .main-wrap {
            margin: 15px auto;
            padding: 15px;
            direction: rtl;
            text-align: justify;
            background-color: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            max-width: 1000px;
            width: 100%;
            box-sizing: border-box;
        }
 
 
        /* =========================================================
          چیدمان تصاویر
        ========================================================= */
 
        .main-flex {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            align-items: center;
            justify-content: center;
        }
 
 
        /* =========================================================
          هر باکس تصویر
        ========================================================= */
 
        .image-box {
            flex: 1 1 30%;
            max-width: 300px;
            text-align: center;
            margin: 0 auto;
        }
 
        .image-box-inner {
            border-radius: 15px;
            overflow: hidden;
        }
 
        .image-box img {
            display: block;
            width: 100%;
            max-width: 300px;
            height: auto;
            margin: 0 auto;
        }
 
 
        /* =========================================================
          حالت موبایل
          فقط تصویر اول نمایش داده می‌شود
        ========================================================= */
 
        @media (max-width: 768px) {
 
            .page-title {
                text-align: center;
                font-size: 34px;
                font-weight: 700;
                margin: 15px 0 20px;
                line-height: 1.6;
            }
 
            .main-wrap {
                padding: 12px !important;
                margin: 10px auto !important;
            }
 
            .main-flex {
                flex-direction: column !important;
                gap: 15px !important;
            }
 
            /* تصویر دوم و سوم در موبایل مخفی شوند */
            .image-box:nth-child(2),
            .image-box:nth-child(3) {
                display: none !important;
            }
 
            /* تصویر اول تمام عرض فضای موجود را بگیرد */
            .image-box:first-child {
                display: block;
                width: 100% !important;
                max-width: 100% !important;
                flex: 1 1 100% !important;
                margin: 0 auto;
            }
 
            .image-box:first-child img {
                width: 100% !important;
                max-width: 300px !important;
                height: auto !important;
                display: block;
                margin: 0 auto;
            }
        }
 


  .main-flex {
        /* =========================================================
    flex-direction: column !important;
          موبایل‌های کوچک
    gap: 15px !important;
        ========================================================= */
  }


  .image-box {
        @media (max-width: 480px) {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }


  .image-box img {
            .page-title {
    width: 100% !important;
                font-size: 32px;
    max-width: 300px !important;
            }
    height: auto !important;
    display: block;
    margin: 0 auto;
  }


  .text-wrap {
            .main-wrap {
    width: 100% !important;
                padding: 10px !important;
    max-width: 100% !important;
            }
    padding: 10px !important;
    box-sizing: border-box;
  }


  .text-box {
            .image-box:first-child img {
    flex: 1 1 100% !important;
                max-width: 100% !important;
    min-width: auto !important;
            }
    padding: 0 !important;
        }
  }
    </style>
}
</style>
</head>
</head>
<body>
<body>
<h2>نوین سرما گستر</h2>
<!-- کانتینر اصلی با طراحی ریسپانسیو و سایه ملایم -->
<div class="main-wrap" style="margin: 15px auto; padding: 15px; direction: rtl; text-align: justify;
            background-color: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); max-width: 1000px; width: 100%; box-sizing: border-box;">
   
    <!-- ایجاد چیدمان انعطاف‌پذیر (Flexbox) با قابلیت شکستن خط در موبایل -->
    <div class="main-flex" style="display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: center;">   
   


    <!-- عنوان اصلی -->
    <h2 class="page-title">
        نوین سرما گستر
    </h2>


   
        <!-- بخش تصویر (در دسکتاپ عرض مشخص دارد و در موبایل وسط‌چین و متناسب می‌شود) -->
        <div class="image-box" style="flex: 1 1 30%; max-width: 300px; text-align: center; margin: 0 auto;">


            <div style="border-radius: 15px; overflow: hidden;">
    <!-- =========================================================
        کانتینر اصلی تصاویر
    ========================================================= -->


<!--https://dl.faraghaib.ir/m/103/gap.png                 نمونه آدرس دهی-->
    <div class="main-wrap">
<img src="https://dl.faraghaib.ir/m/260022-01/visit-01-01.jpg" alt="عطاری و ادویه سرای حافظ" style="width:100%; max-width:300px; height:auto;">
 
        <div class="main-flex">
 
            <!-- =====================================================
                تصویر اول
                در دسکتاپ و موبایل نمایش داده می‌شود
            ====================================================== -->
 
            <div class="image-box">
 
                <div class="image-box-inner">
 
                    <img
                        src="https://dl.faraghaib.ir/m/260022-01/visit-01-01.jpg"
                        alt="عطاری و ادویه سرای حافظ"
                        loading="lazy"
                    >
 
                </div>
 
            </div>
 
 
            <!-- =====================================================
                تصویر دوم
                 فقط در دسکتاپ نمایش داده می‌شود
            ====================================================== -->
 
            <div class="image-box">
 
                <div class="image-box-inner">
 
                    <img
                        src="https://dl.faraghaib.ir/m/260022-01/visit-01-01.jpg"
                        alt="عطاری و ادویه سرای حافظ"
                        loading="lazy"
                    >
 
                </div>
 
            </div>


            </div>     
        </div>


  <!-- بخش تصویر (در دسکتاپ عرض مشخص دارد و در موبایل وسط‌چین و متناسب می‌شود) -->
            <!-- =====================================================
        <div class="image-box" style="flex: 1 1 30%; max-width: 300px; text-align: center; margin: 0 auto;">
                تصویر سوم
            <div style="border-radius: 15px; overflow: hidden;">
                فقط در دسکتاپ نمایش داده می‌شود
            ====================================================== -->


<!--https://dl.faraghaib.ir/m/103/gap.png                  نمونه آدرس دهی-->
            <div class="image-box">
<img src="https://dl.faraghaib.ir/m/260022-01/visit-01-01.jpg" alt="عطاری و ادویه سرای حافظ" style="width:100%; max-width:300px; height:auto;">


            </div>     
                <div class="image-box-inner">
        </div>


                    <img
                        src="https://dl.faraghaib.ir/m/260022-01/visit-01-01.jpg"
                        alt="عطاری و ادویه سرای حافظ"
                        loading="lazy"
                    >


  <!-- بخش تصویر (در دسکتاپ عرض مشخص دارد و در موبایل وسط‌چین و متناسب می‌شود) -->
                </div>
        <div class="image-box" style="flex: 1 1 30%; max-width: 300px; text-align: center; margin: 0 auto;">
            <div style="border-radius: 15px; overflow: hidden;">


<!--https://dl.faraghaib.ir/m/103/gap.png                  نمونه آدرس دهی-->
            </div>
<img src="https://dl.faraghaib.ir/m/260022-01/visit-01-01.jpg" alt="عطاری و ادویه سرای حافظ" style="width:100%; max-width:300px; height:auto;">


            </div>     
         </div>
         </div>


        </div>
     </div>
     </div>
</div>


</body>
</body>
</html>
</html>