Note that there are some explanatory texts on larger screens.

plurals
  1. POFancybox and css
    text
    copied!<p>I have a Fancybox that opens on pageload. Everything is working fine, exept I'm not able to style the pop-up box. It seem like it will not pick up my css. By the way; I'm not familiar with js - I just copy from tutorials! So if the answer includes js, please be very spesific. Thank you!</p> <p>In head:</p> <pre><code> &lt;link rel="stylesheet" type="text/css" href="/js/jquery.fancybox/jquery.fancybox.css" media="screen" /&gt; &lt;link rel="stylesheet" href="/stylesheets/ups-screen.css" type="text/css" /&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jquery.fancybox/jquery.fancybox-1.2.1.pack.js"&gt;&lt;/script&gt; &lt;body onload="$(a'#popup').trigger('click');"&gt; </code></pre> <p>Right before closing body-tag:</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#popup").fancybox().trigger('click'); }); </code></pre> <p></p> <p>The content to load:</p> <pre><code>&lt;a id="popup" href="#melding"&gt;&lt;/a&gt; &lt;div style="display: none;"&gt; &lt;div class="fancybox"&gt; &lt;div id="melding"&gt;&lt;br /&gt; &lt;br /&gt; &lt;h3&gt;Velkommen til min nye hjemmeside.&lt;/h3&gt; &lt;br /&gt; &lt;p&gt;Testing - Testing. &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The css in the ups-screen stylesheet:</p> <pre><code>.fancybox { width: 600px; padding-left: 30px; padding-right: 30px; padding-bottom: 20px; padding-top: 30px; } #melding{ text-decoration:none; } #popup{ background-color:#444; } </code></pre> <p>No matter what I try or do, it returns the same sized square without any padding.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload