jquery - Why is my popup styling messed up? -
i'm using magnific popup create popup form. copied , pasted code "popup form" demo here, resulting in following test file:
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" > <head> <script type="text/javascript" src="../js/jquery-1.8.2.min.js"></script> <script type="text/javascript" src="../js/magnific/jquery.magnific-popup.js"></script> <link rel="stylesheet" type="text/css" href="../css/magnificpopup.css" /> <script type="text/javascript"> $(document).ready(function() { $('.popup-with-form').magnificpopup({ type: 'inline', preloader: false, focus: '#name', // when elemened focused, mobile browsers in cases zoom in // looks not nice, disable it: callbacks: { beforeopen: function() { if($(window).width() < 700) { this.st.focus = false; } else { this.st.focus = '#name'; } } } }); }); </script> </head> <body> <!-- link opens popup --> <a class="popup-with-form" href="#test-form">open form</a> <!-- form --> <form id="test-form" class="white-popup-block mfp-hide"> <h1>form</h1> <fieldset style="border:0;"> <p>lightbox has option automatically focus on first input. it's recommended use <code>inline</code> popup type lightboxes form instead of <code>ajax</code> (to keep entered data if user accidentally refreshed page).</p> <ol> <li> <label for="name">name</label> <input id="name" name="name" placeholder="name" required="" type="text"> </li> <li> <label for="email">email</label> <input id="email" name="email" placeholder="example@domain.com" required="" type="email"> </li> <li> <label for="phone">phone</label> <input id="phone" name="phone" placeholder="eg. +447500000000" required="" type="tel"> </li> <li> <label for="textarea">textarea</label><br> <textarea style="width: 139px; height: 54px;" id="textarea">try resize me see how popup css-based resizing works.</textarea> </li> </ol> </fieldset> </form> </body> </html>
however, while code demo displays this:
the code test page displays this:
what going wrong?
they have applied custom css form.if go demo site , click on open form
under popup form
, inspect, see .white-popup-block
has styles not included in default css. need apply styles container.
.white-popup-block { background: #fff; padding: 20px 30px; text-align: left; max-width: 650px; margin: 40px auto; position: relative; }
Comments
Post a Comment