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

esfandiari>Javid
صفحه‌ای تازه حاوی «<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> @media (max-width: 768px) { .main-wrap { padding: 12px !important; margin: 10px auto !important; } .main-flex { flex-direction: column !important; gap: 15px !important; } .image-box { flex: 1 1 100% !important; max-width: 100% !important; } .image-box img { width: 100% !important; max-width: 300p...» ایجاد کرد
 
جز ۶ نسخه واردشده
 
(۵ نسخهٔ میانی ویرایش شده توسط یک کاربر دیگر نشان داده نشد)
خط ۱: خط ۱:
<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-flex {
    flex-direction: column !important;
    gap: 15px !important;
  }


  .image-box {
        /* =========================================================
    flex: 1 1 100% !important;
          کانتینر اصلی
    max-width: 100% !important;
        ========================================================= */
  }


  .image-box img {
        .main-wrap {
    width: 100% !important;
            margin: 15px auto;
    max-width: 300px !important;
            padding: 15px;
    height: auto !important;
            direction: rtl;
    display: block;
            text-align: justify;
    margin: 0 auto;
            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;
        }


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


  .text-box {
        /* =========================================================
    flex: 1 1 100% !important;
          چیدمان تصاویر
    min-width: auto !important;
        ========================================================= */
    padding: 0 !important;
 
  }
        .main-flex {
}
            display: flex;
</style>
            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;
            }
        }
 
 
        /* =========================================================
          موبایل‌های کوچک
        ========================================================= */
 
        @media (max-width: 480px) {
 
            .page-title {
                font-size: 32px;
            }
 
            .main-wrap {
                padding: 10px !important;
            }
 
            .image-box:first-child img {
                max-width: 100% !important;
            }
        }
    </style>
</head>
</head>
<body>
<body>


<!-- کانتینر اصلی با طراحی ریسپانسیو و سایه ملایم -->
    <!-- عنوان اصلی -->
<div class="main-wrap" style="margin: 15px auto; padding: 15px; direction: rtl; text-align: justify;
    <h2 class="page-title">
            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;">
    </h2>
   
 
     <!-- ایجاد چیدمان انعطاف‌پذیر (Flexbox) با قابلیت شکستن خط در موبایل -->
 
     <div class="main-flex" style="display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: center;">    
     <!-- =========================================================
       
        کانتینر اصلی تصاویر
        <!-- بخش تصویر (در دسکتاپ عرض مشخص دارد و در موبایل وسط‌چین و متناسب می‌شود) -->
     ========================================================= -->
        <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;">
    <div class="main-wrap">


<!--https://dl.faraghaib.ir/m/103/gap.png                  نمونه آدرس دهی-->
        <div class="main-flex">
<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 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 class="image-box">
 
                <div class="image-box-inner">


        <div class="text-wrap" style="width: 600px; max-width: 100%; margin: 1px auto; padding: 5px; direction: rtl; text-align: right;
                    <img
                    background-color: #ffffff; border: 1px solid #89CFF0; border-radius: 12px; box-sizing: border-box;">       
                        src="https://dl.faraghaib.ir/m/260022-01/visit-01-01.jpg"
                <!-- بخش متن (در دسکتاپ عرض بیشتر را می‌گیرد و در موبایل تمام‌عرض می‌شود) -->
                        alt="عطاری و ادویه سرای حافظ"
                <div class="text-box" style="flex: 2 1 70%; min-width: 280px; padding: 5px;">
                        loading="lazy"
                     <div style="font-size: 1em; line-height: 1.8; color: #2d3748; direction: rtl; text-align: justify;">
                     >
برای داشتن یک آشپزی حرفه‌ای و طعم‌های ماندگار، کیفیت ادویه حرف اول را می‌زند؛ محصولات تضمین‌شده <strong>عطاری و ادویه سرای حافظ</strong> بهترین انتخاب برای عطر و رنگ سفره شماست. همچنین برای تهیه محصولات ارگانیک و بهره‌مندی از خواص شفابخش طبیعت، می‌توانید روی تخصص و کیفیت <strong>گیاهان دارویی کریم زایی</strong> حساب ویژه‌ای باز کنید. با اطمینان از اصالت کالا، طعم اصیل و سلامتی را به خانه خود هدیه دهید.


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


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