我的網頁上有一個引導模式,但是每次我打開模式時,它都在陰影下打開,我該如何解決這個問題?
<div id="logoutModal" bsModal #myModal="bs-modal" class="modal"
tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-
hidden="true" >
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Sign Out</h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true" aria-label="Close">×</button>
</div>
<div class="modal-body">
<p><i class="fa fa-question-circle"></i> Are you sure you
want to sign out? <br /></p>
</div>
<div class="modal-footer text-center">
<button class="btn btn-default btn-primary" data-
dismiss="modal" (click)="confirmSignOut()">Sign out</button>
<button class="btn btn-default" data-
dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
我現在有解決辦法了。 1.在我的自定義css文件中
.modal-backdrop {
//hides the default modal shadow
display: none;
}
.modal {
//modal custom bachground/shadow
background: rgba(0,0,0,0.5);
}
or
.modal{
background-color: rgba(0, 0, 0, 0.3);
}
.modal-backdrop{
position: relative;
}
2.我如下寫我的模態html標簽。
<div id="logoutModal" bsModal #myModal="bs-modal" class="modal"
tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-
hidden="true" data-backdrop="false" style="background:
rgba(0,0,0,0.5);">
....
</div>
這解決了我的問題。
當modal不是& ltbody & gt。
太好了,這對我很有效...