Search code examples
jqueryfancybox

How to remove border from Fancybox 2?


I need a bit of help over there. Here I need to remove white border from fancybox iframe http://squaretwo.ru/pashokk .

You can call fancyBox by clicking the red button. I've read previous articles but wasn't able to fix the problem. Any ideas?


Solution

  • You can remove that by adding this to your stylesheet.

    The structure of your iFrame is such,

    <body style="overflow-x: hidden; ">
        <div style="max-width:550px; border: solid 15px #cc0033;" border="1">
           .
           .
           .
        </div>
    </body>
    

    So you can remove the border like so,

    body div:first-child {
        border: 0 !important;
    }
    

    But, this will affect any border properties that you have given to your #header, since that is a div:first-child as well.

    so do a !important for your div#header border properties (IF NEEDED).

    EDIT

    Since you want to get rid of the fancybox background.

    You'll need to add this,

    .fancybox-skin {
        background: transparent;
        box-shadow: none !important;
    }
    

    this is a default class generated by the plugin.

    Also,

    add the following

    html{
      background: white;
    }
    

    If you want the background only inside the red border then don't add the above html css, add the following.

    body div:first-child {
         background: white !important;
    }