首页 > 解决方案 > 通过 css 更改调整大小的属性

问题描述

我有一个可以通过 css 调整大小的 div。

HTML

<div id="resize">
  <img src="{{env.assets_url}}assets/images/minified_signhere.png" [hidden]="!isNameNull(sign.name)" [attr.id]="'sign-img' + myindex">
  <img src="{{env.assets_url}}assets/images/minified_signhere_dim.png" [attr.id]="'dimimg' + myindex" [hidden]="isNameNull(sign.name)">
  <div style="position: absolute;z-index: 1000;left: 100%;" class="signbtns">
  <span style="font-size: 17px; margin-bottom: 5px" class="fa fa-trash float-right change-cursor" aria-hidden="true" (click)="deleteSign(myindex)"
  data-toggle="tooltip" title="Click to delete the signature."></span>
  <span style="font-size: 17px;" class="fa fa-pencil float-right change-cursor" (click)="editSign(myindex)" aria-hidden="true"
  data-toggle="tooltip" title="Click to edit the signature."></span>
  </div>
</div>

以下是CSS

#resize {
  display: flex;
  resize: both;
  overflow:auto;
}
::-webkit-resizer {
  background-color: red;
  cursor: ew-resize;
}

div 正在正确调整大小。我想自定义调整大小的背景颜色,但::-webkit-resizer似乎不起作用。

标签: csshtml

解决方案


你改变的颜色#resize,不是::-webkit-resizer


推荐阅读