How do I darken the div surrounding the alert like a modal?

I need to show to the alert

user and I want it to be pretty. So I use the Bootstrap alert class and show it to the user div

like this:

<div class="alert alert-warning alert-dismissible" role="alert">
    Some text
</div>

      

This code only shows div

. I want everything to be darker apart from this div

(like modals in Bootstrap do). How can i do this?

+3


source to share


1 answer


Opens a modal, only shows a warning.

http://jsfiddle.net/phLg32eL/1

HTML:



<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
    Open alert
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">

            <div class="alert alert-warning alert-dismissible" role="alert">
                Some text
            </div>

        </div>
    </div>
</div>

      

CSS

.modal-content {
    height:52px
}

      

+3


source







All Articles