Azhar Azhar - 9 months ago 49
HTML Question

links inside modal appearing before opening the modal and messing up the page interface

I have a modal which appears when a button is clicked but the links present inside the modal appears before even opening the modal, they are invisible though but they are present because if a user clicks on the page the link inside the modal gets clicked.

To see it, open and hover your mouse over the logo.

<button type="button" class="btn btn-info btn-sm " data-toggle="modal" data-target="#myModal">more</button>

<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog" >
<div class="modal-dialog modal-lg">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h2 class="modal-title">Top Searches</h2>
<div class="modal-body">

lots of links here


<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>



Replace <div class="modal fade" id="myModal" role="dialog" > with <div class="modal fade hide" id="myModal" role="dialog" > This hide class will set your modal inaccessible, bootstrap will take it off when you click the button.

This site you commented uses Bootstrap 2.3 link to documentation. If you edit it, this site will help you.