3

I have a Bootstrap Model working fine, except that it is visible when the document loads and I can't work out how to make the initial state invisible?

<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a> <div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="myModalLabel">Modal header</h3> </div> <div class="modal-body"> <p>One fine body…</p> </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> <button class="btn btn-primary">Save changes</button> </div> </div> 

2 Answers 2

12

Following documentation, add hide class to the modal.

<div class="modal hide fade"> ... </div> 
Sign up to request clarification or add additional context in comments.

2 Comments

The hide class is not needed anymore.
@ThEBiShOp do you know from which version it is not needed anymore? An update to the answer would be great.
4

Turns out simply adding style="display: none" to the modal outer div did the trick.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.