设置导航菜单的背景,当单击背景时,必须关闭导航

i create the navigation Demo and i want to set a black background and that width must be 100% and when click on the background the navigation must be closed .

此导航的重要事项是,内容必须为80%,但背景必须为100%。

 <div id="activity-info" class="activity-info">
<div class="activity-container">
  <div class="activity-header">
    <span id="closeActivityInfo" (click)="closeActivityInfo()">
      <mat-icon>clear</mat-icon>
    </span>
    <div class="activity-info-title">
      <span>
        {{ "GENERAL.ACTIVITY_INFO" | translate }}
      </span>
    </div>
  </div>
  <div class="activity-content">
    <div>
      <div class="item">
        <div class="item-label">{{ "GENERAL.CREATOR" | translate }} :</div>
        <div class="item-value">
          <pfa-user-field
            [displayName]="oldEditModel.creator"
            [row]="false"
          ></pfa-user-field>
        </div>
      </div>
    </div>
  </div>
</div>

CSS代码:

   #showInfos {
    display: block;
    width: 100% !important;
    margin-bottom: 7px !important;
  }
  #closeActivityInfo {
    display: block;
  }
  .activity-info-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
  .activity-info {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: #111;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
  }
  .activity-container {
    width: 100%;
  }
  .edit-form {
    width: 100%;
  }
  .form-content {
    height: 100%;
  }
  .showInfos {
    width: 60px;
    height: 40px;
    background-color: #e52727;
    color: white;
    position: absolute;
    right: 40px;
    bottom: 20px;
  }
}

js代码:

评论