2016-11-16 176 views
-1

我有這樣一個div:CSS:模糊股利

<div class="customer"> 
<div [ngSwitch]="accessLevel"> 
<div class="customer" *ngSwitchCase="'ENABLED'"> 
<h2 class="label">Customer</h2><br> 
<span>{{customerData.oldId}}</span><br> 
<span>{{customerData.firstName}}</span><br> 
<span>{{customerData.lastName}}</span><br> 
<span>{{customerData.addressLine1}}</span><br> 
<span>{{customerData.email}}</span> 
</div> 
<div class="customer-blurr" *ngSwitchCase="'DISABLED'"></div> 
<div class="customer-blurr" *ngSwitchDefault></div> 
</div> 
</div> 

和CSS:

.customer{ 
    float: left; 
    width: 27%; 
    height: 350px; 
    box-sizing: border-box; 
    padding: 15px; 
} 
.customer-blurr { 
    color: transparent; 
    text-shadow: 0 0 5px rgba(0,0,0,0.5); 
    background-color: #ccc; 
    float: left; 
    width: 27%; 
    height: 350px; 
    box-sizing: border-box; 
    padding: 15px; 
} 

當條件殘疾人是真的我想我的股利是模糊的,它也適用,但尺寸/大小不同。請參閱附件中的圖片,查看與標籤寬度相關的尺寸。

請幫我這個。

感謝

blurred Active

+0

使用。客戶[禁用=禁用]你的HTML和切換disabled屬性 –

+0

@D_Supreme在哪裏守我用它嗎?如果你能給我更多的細節,會很棒。謝謝 – Roxy

+0

是否有可能只有一個div?它使用.customer類和ngSwitchCase切換禁用的屬性。然後使用上述類 –

回答

1

有這樣

<div class="customer"> 
<div [ngSwitch]="accessLevel"> 
<div class="customer" disabled = "{ return *ngSwitchCase }"> 
<h2 class="label">Customer</h2><br> 
<span>{{customerData.oldId}}</span><br> 
<span>{{customerData.firstName}}</span><br> 
<span>{{customerData.lastName}}</span><br> 
<span>{{customerData.addressLine1}}</span><br> 
<span>{{customerData.email}}</span> 
</div> 
<div class="customer-blurr" *ngSwitchDefault></div> 
</div> 
</div> 

和CSS作爲

.customer{ 
    float: left; 
    width: 27%; 
    height: 350px; 
    box-sizing: border-box; 
    padding: 15px; 
} 
.customer[disabled=disabled] { 
    color: transparent; 
    text-shadow: 0 0 5px rgba(0,0,0,0.5); 
    background-color: #ccc; 
    float: left; 
    width: 27%; 
    height: 350px; 
    box-sizing: border-box; 
    padding: 15px; 
} 
+0

謝謝很多轉向ji – Roxy