لایه شفاف روی عکس/کافه محمد - فراغیب
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
| خط ۱: | خط ۱: | ||
<html> | <html> | ||
< | <section class="hero-banner"> | ||
<!-- | <!-- پس زمینه --> | ||
<div class="hero- | <div class="hero-bg"></div> | ||
<!-- | <!-- لایه رنگی --> | ||
<div class="hero- | <div class="hero-overlay"></div> | ||
<!-- محتوا --> | |||
<div class="container"> | |||
<div class="hero-content"> | |||
<h1> | |||
کافه پاتوق محمد | |||
</h1> | |||
<p> | |||
محیطی دنج و دلپذیر | |||
</p> | |||
<a href="#" class="hero-btn"> | |||
رزرو و سفارش آنلاین | |||
</a> | |||
</div> | |||
</ | |||
</div> | </div> | ||
</ | </section> | ||
<style> | <style> | ||
/* | /*------------------------ | ||
تنظیمات قابل تغییر | |||
-------------------------*/ | |||
:root{ | |||
/* تصویر */ | |||
--hero-image:url("https://dl.faraghaib.ir/m/260012/26001207.jpg"); | |||
/* رنگ لایه */ | |||
--overlay-color: rgba(121 , 85 , 72,.72); | |||
/* ارتفاع */ | |||
--hero-height:520px; | |||
/* رنگ متن */ | |||
--text-color:#fff; | |||
/* دکمه */ | |||
--btn-bg:#161a88; | |||
--btn-hover:#0d1267; | |||
} | |||
/*------------------------*/ | |||
*{ | |||
margin:0; | |||
padding:0; | |||
box-sizing:border-box; | |||
} | |||
body{ | |||
font-family:tahoma; | |||
direction:rtl; | |||
} | |||
.container{ | |||
width:min(1200px,92%); | |||
margin:auto; | |||
height:100%; | |||
} | |||
.hero-banner{ | |||
position:relative; | |||
height:var(--hero-height); | |||
overflow:hidden; | |||
display:flex; | |||
align-items:center; | |||
} | } | ||
.hero-bg { | .hero-bg{ | ||
position: absolute; | |||
inset: 0; | position:absolute; | ||
inset:0; | |||
background-image: | background-image:var(--hero-image); | ||
background-size: cover; | |||
background-position: center; | background-size:cover; | ||
z-index: 1; | background-position:center; | ||
background-repeat:no-repeat; | |||
z-index:1; | |||
} | } | ||
.hero-overlay { | .hero-overlay{ | ||
position: absolute; | |||
position:absolute; | |||
inset:0; | |||
background:var(--overlay-color); | |||
background: | |||
z-index: 2 | z-index:2; | ||
} | } | ||
. | .hero-content{ | ||
position: relative; | |||
z-index: 3; | position:relative; | ||
z-index:3; | |||
max-width: | |||
max-width:620px; | |||
margin: | |||
margin-right:auto; | |||
align | |||
color:var(--text-color); | |||
text-align:right; | |||
} | } | ||
.hero-content { | .hero-content h1{ | ||
font-size:48px; | |||
line-height:1.6; | |||
margin-bottom:15px; | |||
font-weight:700; | |||
} | } | ||
.hero-content | .hero-content p{ | ||
font-size: | font-size:26px; | ||
line-height: 1. | |||
line-height:1.9; | |||
margin-bottom:35px; | |||
} | } | ||
.hero-content | .hero-btn{ | ||
display:inline-flex; | |||
align-items:center; | |||
justify-content:center; | |||
min-width:190px; | |||
height:58px; | |||
padding:0 30px; | |||
background:var(--btn-bg); | |||
color:#fff; | |||
border-radius:12px; | |||
text-decoration:none; | |||
transition:.3s; | |||
} | } | ||
.hero-btn { | .hero-btn:hover{ | ||
background:var(--btn-hover); | |||
background: | |||
} | } | ||
/* تبلت */ | |||
@media(max-width:992px){ | |||
.hero-banner{ | |||
height:520px; | |||
height: | |||
} | } | ||
.hero- | .hero-content{ | ||
max-width:100%; | |||
} | } | ||
. | .hero-content h1{ | ||
font-size:36px; | |||
} | } | ||
.hero-content { | .hero-content p{ | ||
font-size:22px; | |||
font-size: | |||
} | } | ||
} | } | ||
@media (max-width: | /* موبایل */ | ||
.hero- | |||
height: | @media(max-width:768px){ | ||
.hero-banner{ | |||
height:430px; | |||
} | } | ||
.hero- | .hero-content{ | ||
text-align:center; | |||
margin:auto; | |||
} | } | ||
.hero-content { | .hero-content h1{ | ||
font-size:28px; | |||
line-height:1.8; | |||
} | } | ||
.hero-content | .hero-content p{ | ||
font-size: | |||
font-size:18px; | |||
margin-bottom:25px; | |||
} | } | ||
.hero- | .hero-btn{ | ||
width:100%; | |||
max-width:260px; | |||
} | } | ||
} | } | ||
</style> | </style> | ||
</html> | </html> | ||
نسخهٔ ۸ اوت ۲۰۲۶، ساعت ۰۸:۳۴