-1

This is the Home Page Code

    <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HZ Everything Business</title>
    <link rel="stylesheet" href="home.css" />
    <style>
    
    
.menu {
  height: 70px;
  width: 70px;
  right: 70px;
  top: 20px;
  text-align: center;
  position: absolute;
  background: #fff;
  overflow: hidden;
  transition: all 0.2s ease;
  z-index: 999;
}
.menu.active {
  width: calc(100% - 140px);
}
.menu.active .menuContent * {
  opacity: 1;
}
.menu.active span i:nth-child(1) {
  transform: rotate(-45deg) translate(-50%, -50%);
  top: 50%;
}
.menu.active span i:nth-child(2) {
  transform: translateX(-100px);
  opacity: 0;
}
.menu.active span i:nth-child(3) {
  transform: rotate(45deg) translate(-50%, -50%);
  top: 50%;
}
.menu span {
  width: 70px;
  height: 70px;
  position: absolute;
  right: 0;
  cursor: pointer;
  background: #fff;
  z-index: 1;
}
.menu span i {
  position: absolute;
  transform-origin: 50% 50%;
  width: 45%;
  height: 2px;
  left: 0;
  right: 0;
  margin: auto;
  background-color: #ccc;
  transition: transform 0.3s ease, opacity 0.1s ease 0.1s;
}
.menu span i:nth-child(1) {
  top: 40%;
}
.menu span i:nth-child(2) {
  top: 50%;
}
.menu span i:nth-child(3) {
  top: 60%;
}
.menu .menuContent {
  position: absolute;
  width: 100%;
  height: 100%;
  line-height: 40px;
  right: 0px;
  text-align: center;
}
.menu .menuContent * {
  opacity: 0;
}
.menu .menuContent ul li {
  display: inline-block;
  margin-left: 50px;
  margin-right: 50px;
  color: #2d3235;
  transition: opacity 0.3s ease 0.3s;
  cursor: pointer;
  position: relative;
}
.menu .menuContent ul li:hover:before {
  opacity: 0.8;
  top: 13px;
  left: 20px;
}
.menu .menuContent ul li:hover:after {
  opacity: 0.8;
  bottom: 13px;
  left: -20px;
}
.menu .menuContent ul li:before, .menu .menuContent ul li:after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: #ccc;
  transition: all 0.3s ease;
}
.menu .menuContent ul li:before {
  transform: rotate(-55deg);
  left: 60px;
  top: -30px;
  opacity: 0;
  right: 0;
  margin: auto;
}
.menu .menuContent ul li:after {
  transform: rotate(-55deg);
  left: -60px;
  bottom: -30px;
  opacity: 0;
  right: 0;
  margin: auto;
}
  
 
    
    
    </style>
</head>
<body>
    <div class='menu'>
  <span class='toggle'>
    <i></i>
    <i></i>
    <i></i>
  </span>
  <div class='menuContent'>
    <ul>
      <li>HZ Social Media Agency</li>
      <li>HZ WEBSITE & APP DEV</li>
      <li>HZ PHOTO & VIDEO EDITING</li>
      <li>OUR WORK</li>
    </ul>
  </div>
</div>
 
<script
  src="https://code.jquery.com/jquery-3.3.1.js"
   ></script>
<script>
    $('.toggle').on('click', function() {
    $('.menu').toggleClass('active');
});
    
</script>

<div class="bg"></div>
</body>
</html>

CSS

bg {
    height: 100%;
    width: 100%;
    background-color: blue;
    clip-path: polygon(100% 0, 100% 25%, 0 90%, 0 61%, 0 0);
    position: absolute;
    z-index: -1;
}

I have tried everything I can do but it does not work , I tried changing the name of the CSS file even but it is still not working, any idea how I can fix that ? I have also tried putting it in the "styling tag as bg {} but still did not work , could it have something to do with where I typed the link ? under the title tags ?

2 Answers2

0

You need to add . to the bg since its a class. Also, link is an empty tag.

.bg {
  height: 100%;
  width: 100%;
  background-color: blue;
  clip-path: polygon(100% 0, 100% 25%, 0 90%, 0 61%, 0 0);
  position: absolute;
  z-index: -1;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>HZ Everything Business</title>
  <link rel="stylesheet" href="home.css">
  <style>
    .menu {
      height: 70px;
      width: 70px;
      right: 70px;
      top: 20px;
      text-align: center;
      position: absolute;
      background: #fff;
      overflow: hidden;
      transition: all 0.2s ease;
      z-index: 999;
    }
    
    .menu.active {
      width: calc(100% - 140px);
    }
    
    .menu.active .menuContent * {
      opacity: 1;
    }
    
    .menu.active span i:nth-child(1) {
      transform: rotate(-45deg) translate(-50%, -50%);
      top: 50%;
    }
    
    .menu.active span i:nth-child(2) {
      transform: translateX(-100px);
      opacity: 0;
    }
    
    .menu.active span i:nth-child(3) {
      transform: rotate(45deg) translate(-50%, -50%);
      top: 50%;
    }
    
    .menu span {
      width: 70px;
      height: 70px;
      position: absolute;
      right: 0;
      cursor: pointer;
      background: #fff;
      z-index: 1;
    }
    
    .menu span i {
      position: absolute;
      transform-origin: 50% 50%;
      width: 45%;
      height: 2px;
      left: 0;
      right: 0;
      margin: auto;
      background-color: #ccc;
      transition: transform 0.3s ease, opacity 0.1s ease 0.1s;
    }
    
    .menu span i:nth-child(1) {
      top: 40%;
    }
    
    .menu span i:nth-child(2) {
      top: 50%;
    }
    
    .menu span i:nth-child(3) {
      top: 60%;
    }
    
    .menu .menuContent {
      position: absolute;
      width: 100%;
      height: 100%;
      line-height: 40px;
      right: 0px;
      text-align: center;
    }
    
    .menu .menuContent * {
      opacity: 0;
    }
    
    .menu .menuContent ul li {
      display: inline-block;
      margin-left: 50px;
      margin-right: 50px;
      color: #2d3235;
      transition: opacity 0.3s ease 0.3s;
      cursor: pointer;
      position: relative;
    }
    
    .menu .menuContent ul li:hover:before {
      opacity: 0.8;
      top: 13px;
      left: 20px;
    }
    
    .menu .menuContent ul li:hover:after {
      opacity: 0.8;
      bottom: 13px;
      left: -20px;
    }
    
    .menu .menuContent ul li:before,
    .menu .menuContent ul li:after {
      content: "";
      position: absolute;
      width: 20px;
      height: 2px;
      background: #ccc;
      transition: all 0.3s ease;
    }
    
    .menu .menuContent ul li:before {
      transform: rotate(-55deg);
      left: 60px;
      top: -30px;
      opacity: 0;
      right: 0;
      margin: auto;
    }
    
    .menu .menuContent ul li:after {
      transform: rotate(-55deg);
      left: -60px;
      bottom: -30px;
      opacity: 0;
      right: 0;
      margin: auto;
    }
  </style>
</head>

<body>
  <div class='menu'>
    <span class='toggle'>
    <i></i>
    <i></i>
    <i></i>
  </span>
    <div class='menuContent'>
      <ul>
        <li>HZ Social Media Agency</li>
        <li>HZ WEBSITE & APP DEV</li>
        <li>HZ PHOTO & VIDEO EDITING</li>
        <li>OUR WORK</li>
      </ul>
    </div>
  </div>

  <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
  <script>
    $('.toggle').on('click', function() {
      $('.menu').toggleClass('active');
    });
  </script>

  <div class="bg"></div>
</body>

</html>
TechySharnav
  • 4,869
  • 2
  • 11
  • 29
0

Create css file in a folder.

Add link to that css in head section.

Add version to css so it will reloaded with changes / clear caches of browser.

( More info - Why adding version number to CSS file path? )

e.g.

 <!DOCTYPE html>
  <html lang="en">
   <head>
     <meta charset="UTF-8">
      <title>HZ Everything Business</title>
       <link rel="stylesheet" type="text/css" href="./Folder_Name/home.css?v=1.1" />
      // U can change 1.1 to other numbers before refreshing page. so changes made in home.css will be reflected.
   </head>