Reputation: 13
i have a problem with my popup i want the background to be transparent but when i set opacity in css to 0.5 or less the text also is transparent and very dark. How can i set the background to 50% opacity but the text is still 100%? Help would be nice :)
Heres the full code: https://jsfiddle.net/Lwbmdw2g/
Here the html:
<div class="modal fade" id="myModall" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog imp-bg">
<div class="modal-content imp-bg">
<div class="modal-header imp-bg">
<div class="title">
<div></div>
News
</div>
</div>
<div class="modal-body">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 imp-block">
<p class="mini imp-mini">
<strong>Hier steht der News Text.</strong><br />
<br /><br />
</p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default imp-button" data-dismiss="modal">X</button>
</div>
</div>
</div>
</div>
Here the modal opening as requested:
<script type="text/javascript">
$(window).on('load',function(){
$('#myModall').modal('show');
});
</script>
Upvotes: 1
Views: 21008
Reputation: 1
<div class="modal-dialog imp-bg">
.modal-dialog imp-bg
{
opacity: 0.5;
background-color: rgb(10, 10, 10);
}
Upvotes: 0
Reputation: 68
I thing it will help u. set your background opacity according to your need.
#myModall { background: rgba(0,0,0,.5); }
Upvotes: 1
Reputation: 46
As Albzi mentioned using rgba works. Change your imp-bg style to this.
.imp-bg{background:rgba(0,0,0,0.7);}
Upvotes: 3