الگو:کانتینر عکس و متن/امامی: تفاوت میان نسخهها
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...» ایجاد کرد |
Esfandiari (بحث | مشارکتها) جز ۶ نسخه واردشده |
||
| (۵ نسخهٔ میانی ویرایش شده توسط یک کاربر دیگر نشان داده نشد) | |||
| خط ۱: | خط ۱: | ||
<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> | |||
<style> | |||
/* ========================================================= | |||
تنظیمات عنوان | |||
========================================================= */ | |||
.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; | ||
</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> | ||
<!-- | <!-- عنوان اصلی --> | ||
< | <h2 class="page-title"> | ||
نوین سرما گستر | |||
</h2> | |||
<!-- | |||
<!-- ========================================================= | |||
کانتینر اصلی تصاویر | |||
========================================================= --> | |||
<div class="main-wrap"> | |||
< | <div class="main-flex"> | ||
</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"> | |||
<img | |||
src="https://dl.faraghaib.ir/m/260022-01/visit-01-01.jpg" | |||
alt="عطاری و ادویه سرای حافظ" | |||
loading="lazy" | |||
> | |||
</div> | </div> | ||
</div> | |||
</div> | </div> | ||
</div> | </div> | ||
</body> | </body> | ||
</html> | </html> | ||