Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>...except I'm not able to style the pop-up box. It seem like it will not pick up my css. </code></pre> <p>Well, you got to know how fancybox works with <code>inline</code> content (the hidden <code>&lt;div&gt;</code> you want to display in fancybox) :</p> <p>First, you are targeting the container with <code>id="melding"</code> with this html :</p> <pre><code>&lt;a id="popup" href="#melding"&gt;&lt;/a&gt; </code></pre> <p>When you open fancybox, the <code>&lt;div id="melding"&gt;...&lt;/div&gt;</code> is <strong>MOVED</strong> from its original position in the document into fancybox. A temporary <em>placeholder</em> is left instead so the content can be returned to where it was when you close fancybox.</p> <p>... so this is how your (<code>inline</code>) content looks <strong>before</strong> opening fancybox:</p> <pre><code>&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>.... and this is how it looks <strong>after</strong> you open fancybox (v2.1.2)</p> <pre><code>&lt;div style="display: none;"&gt; &lt;div class="fancybox"&gt; &lt;div class="fancybox-placeholder" style="display: none; "&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>.... of course <code>&lt;div id="melding"&gt;...&lt;/div&gt;</code> is inside fancybox.</p> <p>A question for you : Can you see the issue? Answer : you are applying your style to the selector <code>.fancybox</code></p> <pre><code>.fancybox { width: 600px; padding-left: 30px; padding-right: 30px; padding-bottom: 20px; padding-top: 30px; } </code></pre> <p>... but that selector never made it to fancybox, so this why you cannot style it.</p> <p>Your options :</p> <p><strong>One</strong> : set the style you want to <code>#melding</code> as properly pointed out by <strong>@bbosternak</strong></p> <p>...or</p> <p><strong>Two</strong> : change your html structure like</p> <pre><code>&lt;div id="melding" style="display: none;"&gt; &lt;div class="fancybox"&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; </code></pre> <p>Notice that I moved the <code>id="melding"</code> to the parent <code>&lt;div&gt;</code> of the <code>&lt;div class="fancybox"&gt;</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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