我正在使用 ngx-dropzone 库,但是当我拖动文件时,它们会变得非常大。为了解决这个问题,我尝试通过 CSS 更改大小,但无济于事。
谁能帮帮我?我想要的高度和宽度大约为 20px
HTML
<ngx-dropzone-label>
<div>
<h2>My custom dropzone</h2>
</div>
</ngx-dropzone-label>
<ngx-dropzone-image-preview ngProjectAs="ngx-dropzone-preview" *ngFor="let f of files" [file]="f" [removable]="true" (removed)="onRemove(f)">
<ngx-dropzone-label>{{ f.name }} ({{ f.type }})</ngx-dropzone-label>
</ngx-dropzone-image-preview>
CSS
.custom-dropzone {
height: 250px;
background: #333;
color: #fff;
border: 5px dashed rgb(235, 79, 79);
border-radius: 5px;
font-size: 20px;
}
最佳答案
你可以像下面这样定位 ngx-dropzone-preview
ngx-dropzone-preview{
height: 40px !important;
min-height: 40px !important;
min-width: 40px !important;
max-width: 40px !important;
}
关于html - 我无法更改元素的设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59097000/