CSS apply if the page is displayed in a frame

Home Forums Support CSS apply if the page is displayed in a frame

Home Forums Support CSS apply if the page is displayed in a frame

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #137927
    Oleg

    Tom, tell me if this is possible. Apply CSS, only in the event that the page is displayed in another place by frame. Maybe with another plugin. I found a plug-in “Fresh Custom Code”, it allows you to set the conditional logic for displaying CSS, for example, post categories or mobile devices, but no frames.

    #138034
    Tom
    Lead Developer
    Lead Developer

    What do you mean by frames? IFrames?

    #138053
    Oleg

    Yes.

    #138136
    Tom
    Lead Developer
    Lead Developer

    You’d just put iframe in front of your CSS selectors.

    iframe .my-class {
    
    }
    #138152
    Oleg

    I try:

    iframe {
    .site-header {display:none;}
    .site-info {display:none;}
    }

    does not work.

    but is working

    iframe {
    margin-top:50px;
    margin-left:0px;
    }

    but you need it – site-header, site-info

    #138233
    Tom
    Lead Developer
    Lead Developer

    It would be:

    iframe .site-header,
    iframe .site-info {
        display:none;
    }
    #138351
    Oleg

    No, it does not work either. What could be wrong?

    #138378
    Tom
    Lead Developer
    Lead Developer

    I’m not sure – this is more of an HTML issue than a GP/WordPress issue.

    The code I gave above will work if you have those elements (.site-header and .site-info) inside an iframe element (no idea why this would be the case).

    Either way, you’ll need to either adjust your HTML or CSS.

    #138492
    Oleg

    Tom, see for yourself.
    Completely clean installation WordPress and GeneratePress.

    1
    2
    3

    Site: http://olegte.bget.ru/wp-admin/, login/password for admin – demo/demo.

    #138538
    Tom
    Lead Developer
    Lead Developer

    I’m not seeing that on this page?: http://olegte.bget.ru/iframe/

    Have you removed it?

    #138541
    Oleg

    No, there is only the name of the “IFRAME” and the word “text” in the content.

    #138542
    Tom
    Lead Developer
    Lead Developer
    #138543
    Oleg

    It says about the pages on a different domain. In my case the page on the same domain. ?

    #138544
    Tom
    Lead Developer
    Lead Developer

    Then why not just hide the site header and other elements on that site before embedding it in an iframe?

    From what I’ve read, it’s not possible to apply CSS to the contents of an iframe.

    #138545
    Oleg

    I want to make sure that the page can be opened from another location in the pop-up window, in an abbreviated form.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.