۱ مهتا رحمتی
مشکل در قرار دادن کد‌های div overlay بر روی عکس وفیکس نشدن سایه بر ان
جامعه Html & CSS ایجاد شده در ۰۳ مرداد ۱۴۰۴


سلام من همه چی عین استاد نوشتم اما وقتی سایز کمتر از 1200 میشه عین خود استاد نمیشه
 

image-7ehw1a4j.png

کد‌ها :
.img-header{

   min-height: 95vh;

}

div.overlay{

    width: 100%;

   

    background-color: rgba(0, 0, 0,.2);

    min-height: 95vh;

}

.header-titel{

    color: white;

    margin: 290px auto;

    max-width: 380px;

}

.header-titel a{

background-color: rgb(235, 177, 135);

padding: 5px 1px;

border-radius: 3px;

color: white;

float: left;

margin-left: 30px;

}

@media screen and (max-width:1200px){

    .header-titel{

        width: 100%;

        margin: 0;

       background-color: rgb(255, 255, 255,.4);

       color: black;

       padding: 20px;

    position: absolute;

    top: 50%;

    left: 50%;

    transform: translate(-50%,-50%);

    border-radius: 5px;

  }

  .verlay, .img-header{

    min-height: 100%;

  }

}

@media screen and (max-width:678px){

    .header-titel h1{

        font-size: 20px;

    }

    .header-titel h3{

        font-size:16px ;

    }

    .header-titel a{

        font-size: 14px;

    }

}
<!DOCTYPE html>

<html lang="fa" dir="rtl">

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>جلسه اول</title>

    <link

      rel="stylesheet"

      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"

      integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="

      crossorigin="anonymous"

      referrerpolicy="no-referrer"

    />

    <link rel="stylesheet" href="../css/grid-layout.css" />

    <link rel="stylesheet" href="../css/style.css" />

    <style></style>

  </head>

  <body>

    <div class="container-fluid container-fluid-custom">

      <div class="container">

        <div class="row">

          <div class="col-xs-6 col-s-6 col-md-6 col-l-6 col-xl-6 contact">

            <i class="fa-solid fa-envelope xs-hidden"

              ><span class="xs-hidden"> MAHTA@1234</span></i

            >

            <i class="fa-solid fa-phone"><span>1234567899</span></i>

          </div>

          <div class="col-xs-6 col-s-6 col-md-6 col-l-6 col-xl-6 media">

            <a href=""><i class="fa-brands fa-telegram"></i></a>

            <a class="xs-hidden" href=""

              ><i class="fa-brands fa-facebook"></i

            ></a>

            <a href=""><i class="fa-brands fa-instagram"></i></a>

            <a class="xs-hidden" href=""

              ><i class="fa-brands fa-twitter"></i

            ></a>

          </div>

        </div>

      </div>

    </div>

    <nav class="nav" id="mynav">

      <div class="container">

        <div class="row">

          <div class="col-xs-12 col-s-12 col-md-12 col-l-12 col-xl-12">

            <a href=""><i class="fa-solid fa-graduation-cap"></i></a>

            <a href="" class="active">خانه</a>

            <a href="">دوره آموزشی</a>

            <a href="">درباره ما</a>

            <a href="">مطالب ها</a>

            <a href="javascript:void(0)" class="icon" onclick="myFunc();"

              ><i class="fa-solid fa-bars"></i

            ></a>

          </div>

        </div>

      </div>

    </nav>

    <header class="container-fluid">

     <div class="row">

      <div class="col-xs-12 col-s-12 col-md-12 col-l-12 col-xl-12 p-0">

        <figure>

          <div class="overlay absolute">

            <div class="header-titel">

            <h1 class="mb-20">آموزش نوین </h1>

            <h3 class="mb-20">برگزاری دوره‌های برنامه نویسی و آموزش کامپیوتر</h3>

           <a class="mb-20" href="">بیشتر بدانید....</a>

           </div>

          </div>

          <img class=" img-header img-responsive" src="../img/header.jpg" alt="">

        </figure>

      </div>

     </div>

    </header>

    <script src="/my project1/main.js"></script>

  </body>

</html>


*,

body {

  margin: 0;

  padding: 0;

  box-sizing: border-box;

  font-family: Vazir-Medium;

}

body {

  direction: rtl;

}

a {

  text-decoration: none;

}

figure{

  position: relative;

}

li,

ol,

ul {

  margin: 0;

  padding: 0;

  list-style: none;

}

.red-Color {

  background-color: red;

}

.yellow-Color {

  background-color: yellow;

}

.blue-Color {

  background-color: blue;

}

.darkblue-Color{

  background-color: rgb(20, 20, 59);

}

.green-Color {

  background-color: green;

}

.gray-Color {

  background-color: #eee;

}

.mb-20{

  margin-bottom: 20px;

}

.mt-20{

  margin-top: 20px;

}

.mt-100{

  margin-top: 100px;

}

.mt-250{

  margin-top: 250px;

}

.p-0{

  padding: 0!important;

}

.m-0{

  margin: 0;

}

.m-50{

  margin: 50px;

}

.text-center{

  text-align: center;

}

.img-responsive{

  width: 100%;

  height: auto;

  display: block;

}

.relative{

  position: relative;

}

.absolute{

  position: absolute;

}

.round-corner{

  border-radius: 5px;

}

.box-shadow{

  box-shadow: 0px 0px 2px 0px #d0d0d0;

}

.container-fluid {

  width: 100%;

}

.clear{

  clear: both;

}

.container {

  clear: both;

  max-width: 1200px;

  /* margin: 0 auto; */

  margin-left: auto;

  margin-right: auto;


 

}

.row::after {

  content: "";

  clear: both;

  display: table;

}


 

[class^="col-"] {

  float: right;

  padding-left: 15px;

  padding-right: 15px;

}

@media only screen and (max-width: 600px) {

  .xs-hidden{

    display: none;

  }

  .col-xs-1 {

    width: 8.33%;

  }

  .col-xs-2 {

    width: 16.66%;

  }

  .col-xs-3 {

    width: 25%;

  }

  .col-xs-4 {

    width: 33.33%;

  }

  .col-xs-5 {

    width: 41.66%;

  }

  .col-xs-6 {

    width: 50%;

  }

  .col-xs-7 {

    width: 58.33%;

  }

  .col-xs-8 {

    width: 66.66%;

  }

  .col-xs-9 {

    width: 75%;

  }

  .col-xs-10 {

    width: 83.33%;

  }

  .col-xs-11 {

    width: 91.66%;

  }

  .col-xs-12 {

    width: 100%;

  }

  .col-xs-offset-0{

    margin-right: 0;

  }

  .col-xs-offset-1{

    margin-right: 8.33%;

  }

  .col-xs-offset-2{

    margin-right: 16.66%;

  }

  .col-xs-offset-3{

    margin-right: 25%;

  }

  .col-xs-offset-4{

    margin-right: 33.33%;

  }

  .col-xs-offset-5{

    margin-right: 41.66%;

  }

  .col-xs-offset-6{

    margin-right: 50%;

  }

  .col-xs-offset-7{

    margin-right: 58.33%;

  }

  .col-xs-offset-8{

    margin-right: 66.66%;

  }

  .col-xs-offset-9{

    margin-right: 75%;

  }

  .col-xs-offset-10{

    margin-right: 83.33%;

  }

  .col-xs-offset-11{

    margin-right: 91.66%;

  }

  .col-xs-offset-12{

    margin-right: 100%;

  }

}

@media only screen and (min-width: 600px) {

  .s-hidden{

    display: none;

  }

  .col-s-1 {

    width: 8.33%;

  }

  .col-s-2 {

    width: 16.66%;

  }

  .col-s-3 {

    width: 25%;

  }

  .col-s-4 {

    width: 33.33%;

  }

  .col-s-5 {

    width: 41.66%;

  }

  .col-s-6 {

    width: 50%;

  }

  .col-s-7 {

    width: 58.33%;

  }

  .col-s-8 {

    width: 66.66%;

  }

  .col-s-9 {

    width: 75%;

  }

  .col-s-10 {

    width: 83.33%;

  }

  .col-s-11 {

    width: 91.66%;

  }

  .col-s-12 {

    width: 100%;

  }

  .col-s-offset-0{

    margin-right: 0;

  }

  .col-s-offset-1{

    margin-right: 8.33%;

  }

  .col-s-offset-2{

    margin-right: 16.66%;

  }

  .col-s-offset-3{

    margin-right: 25%;

  }

  .col-s-offset-4{

    margin-right: 33.33%;

  }

  .col-s-offset-5{

    margin-right: 41.66%;

  }

  .col-s-offset-6{

    margin-right: 50%;

  }

  .col-s-offset-7{

    margin-right: 58.33%;

  }

  .col-s-offset-8{

    margin-right: 66.66%;

  }

  .col-s-offset-9{

    margin-right: 75%;

  }

  .col-s-offset-10{

    margin-right: 83.33%;

  }

  .col-s-offset-11{

    margin-right: 91.66%;

  }

  .col-s-offset-12{

    margin-right: 100%;

  }

}


 

@media only screen and (min-width: 768px) {

  .m-visible{

display: inline-block;

  }

  .col-md-1 {

    width: 8.33%;

  }

  .col-md-2 {

    width: 16.66%;

  }

  .col-md-3 {

    width: 25%;

  }

  .col-md-4 {

    width: 33.33%;

  }

  .col-md-5 {

    width: 41.66%;

  }

  .col-md-6 {

    width: 50%;

  }

  .col-md-7 {

    width: 58.33%;

  }

  .col-md-8 {

    width: 66.66%;

  }

  .col-md-9 {

    width: 75%;

  }

  .col-md-10 {

    width: 83.33%;

  }

  .col-md-11 {

    width: 91.66%;

  }

  .col-md-12 {

    width: 100%;

  }

  .col-md-offset-0{

    margin-right: 0;

  }

  .col-md-offset-1{

    margin-right: 8.33%;

  }

  .col-md-offset-2{

    margin-right: 16.66%;

  }

  .col-md-offset-3{

    margin-right: 25%;

  }

  .col-md-offset-4{

    margin-right: 33.33%;

  }

  .col-md-offset-5{

    margin-right: 41.66%;

  }

  .col-md-offset-6{

    margin-right: 50%;

  }

  .col-md-offset-7{

    margin-right: 58.33%;

  }

  .col-md-offset-8{

    margin-right: 66.66%;

  }

  .col-md-offset-9{

    margin-right: 75%;

  }

  .col-md-offset-10{

    margin-right: 83.33%;

  }

  .col-md-offset-11{

    margin-right: 91.66%;

  }

  .col-md-offset-12{

    margin-right: 100%;

  }

}

@media only screen and (min-width: 992px) {

  .col-l-1 {

    width: 8.33%;

  }

  .col-l-2 {

    width: 16.66%;

  }

  .col-l-3 {

    width: 25%;

  }

  .col-l-4 {

    width: 33.33%;

  }

  .col-l-5 {

    width: 41.66%;

  }

  .col-l-6 {

    width: 50%;

  }

  .col-l-7 {

    width: 58.33%;

  }

  .col-l-8 {

    width: 66.66%;

  }

  .col-l-9 {

    width: 75%;

  }

  .col-l-10 {

    width: 83.33%;

  }

  .col-l-11 {

    width: 91.66%;

  }

  .col-l-12 {

    width: 100%;

  }

  .col-l-offset-0{

    margin-right: 0;

  }

  .col-l-offset-1{

    margin-right: 8.33%;

  }

  .col-l-offset-2{

    margin-right: 16.66%;

  }

  .col-l-offset-3{

    margin-right: 25%;

  }

  .col-l-offset-4{

    margin-right: 33.33%;

  }

  .col-l-offset-5{

    margin-right: 41.66%;

  }

  .col-l-offset-6{

    margin-right: 50%;

  }

  .col-l-offset-7{

    margin-right: 58.33%;

  }

  .col-l-offset-8{

    margin-right: 66.66%;

  }

  .col-l-offset-9{

    margin-right: 75%;

  }

  .col-l-offset-10{

    margin-right: 83.33%;

  }

  .col-l-offset-11{

    margin-right: 91.66%;

  }

  .col-l-offset-12{

    margin-right: 100%;

  }

}

@media only screen and (min-width: 1200px) {

  .col-xl-offset-0{

    margin-right: 0;

  }

  .colxl-1 {

    width: 8.33%;

  }

  .col-xl-2 {

    width: 16.66%;

  }

  .col-xl-3 {

    width: 25%;

  }

  .col-xl-4 {

    width: 33.33%;

  }

  .col-xl-5 {

    width: 41.66%;

  }

  .col-xl-6 {

    width: 50%;

  }

  .col-xl-7 {

    width: 58.33%;

  }

  .col-xl-8 {

    width: 66.66%;

  }

  .col-xl-9 {

    width: 75%;

  }

  .col-xl-10 {

    width: 83.33%;

  }

  .col-xl-11 {

    width: 91.66%;

  }

  .col-xl-12 {

    width: 100%;

  }

  .col-xl-offset-1{

    margin-right: 8.33%;

  }

  .col-xl-offset-2{

    margin-right: 16.66%;

  }

  .col-xl-offset-3{

    margin-right: 25%;

  }

  .col-xl-offset-4{

    margin-right: 33.33%;

  }

  .col-xl-offset-5{

    margin-right: 41.66%;

  }

  .col-xl-offset-6{

    margin-right: 50%;

  }

  .col-xl-offset-7{

    margin-right: 58.33%;

  }

  .col-xl-offset-8{

    margin-right: 66.66%;

  }

  .col-xl-offset-9{

    margin-right: 75%;

  }

  .col-xl-offset-10{

    margin-right: 83.33%;

  }

  .col-xl-offset-11{

    margin-right: 91.66%;

  }

  .col-xl-offset-12{

    margin-right: 100%;

  }

}


 

سلام. وقت بخیر
لطفا کدهای پروژتون رو به صورت کامل در کدپن قرار بدید و لینکش رو بگذارید تا به صورت لایو بتونیم بررسی کنیم.

سحر پاشائی ۰۴ مرداد ۱۴۰۴، ۱۲:۳۹