div的四个角有四个小框(主要就是position)

发布时间:2024年01月22日

html

<div class="echart">
  <div ref="middleGraph" class="echartStyle"></div>
  <div class="inner-left">
    <div class="innerTitle">2''AveWD</div>
    <div
      class="innerContent"
      :style="isNaN(awosData2.ws2m) ? 'font-size:30px' : ''"
    >
      {{ awosData2.ws2m }}
    </div>
  </div>
  <div class="inner-right">
    <div class="innerTitle">2''AveWS</div>
    <div
      class="innerContent"
      :style="isNaN(awosData2.ws2x) ? 'font-size:30px' : ''"
    >
      {{ awosData2.ws2x }}
    </div>
  </div>
  <div class="inner-bottom-left">
    <div class="innerTitle">InsWD</div>
    <div
      class="innerContent"
      :style="isNaN(awosData2.wdins) ? 'font-size:30px' : ''"
    >
      {{ awosData2.wdins }}
    </div>
  </div>
  <div class="inner-bottom-right">
    <div class="innerTitle">InsWS</div>
    <div
      class="innerContent"
      :style="isNaN(awosData2.wsins) ? 'font-size:30px' : ''"
    >
      {{ awosData2.wsins }}
    </div>
  </div>
</div>

css:

.echart {
  width: 73%;
  height: 100%;
  margin: auto;
  position: relative;
  display: inline-block;
}
.echartStyle {
  width: 100%;
  height: 100%;
  background: "red";
}
.inner-left {
  position: absolute;
  top: 0;
  left: 0;
  height: 4rem;
  width: 6rem;
  box-shadow: 1px 0px 0px 0px #595959 inset, -1px 0px 0px 0px #595959 inset,
    0px 0px 0px 0px #595959 inset, 0px -1px 0px 0px #595959 inset;
}
.inner-right {
  position: absolute;
  top: 0;
  right: 0;
  height: 4rem;
  width: 6rem;
  box-shadow: 1px 0px 0px 0px #555555 inset, -1px 0px 0px 0px #555555 inset,
    0px 0px 0px 0px #555555 inset, 0px -1px 0px 0px #555555 inset;
}
.inner-bottom-left {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4rem;
  width: 6rem;
  box-shadow: 1px 0px 0px 0px #555555 inset, -1px 0px 0px 0px #555555 inset,
    0px 0px 0px 0px #555555 inset, 0px -1px 0px 0px #555555 inset;
}
.inner-bottom-right {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 4rem;
  width: 6rem;
  box-shadow: 1px 0px 0px 0px #555555 inset, -1px 0px 0px 0px #555555 inset,
    0px 0px 0px 0px #555555 inset, 0px -1px 0px 0px #555555 inset;
}
.innerTitle {
  width: 100%;
  height: 2rem;
  background: #555555;
  box-shadow: 1px 0px 0px 0px #555555 inset, -1px 0px 0px 0px #555555 inset,
    0px 1px 0px 0px #555555 inset, 0px -1px 0px 0px #555555 inset;
  text-align: center;
  color: #f0f4f5;
  font-weight: 700;
  line-height: 2rem;
  font-size: 1rem;
  /* padding: 0px; */
}
.innerContent {
  width: 100%;
  height: 2rem;
  text-align: center;
  /* padding: 0px 10px; */
  line-height: 2rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f5f2f2;
  font-family: zcool-gdh Regular, zcool-gdh Regular-Regular;
}

文章来源:https://blog.csdn.net/qq_42192641/article/details/135751419
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。