White space is still present around the iframe border even after after setting frameborder to 0

后端 未结 8 1327
终归单人心
终归单人心 2021-01-18 00:01

Even After setting the frameborder attribute in the iframe to 0 there is still some white space present around the iframe border (unlike the original url/link page). Is ther

相关标签:
8条回答
  • 2021-01-18 00:42

    Maybe that whitespace is actually the outside margin of the document loaded in the <iframe>. Try styling the loaded document with:

    html, body {
        border: 0px;
        margin: 0px;
        padding: 0px;
    }
    
    0 讨论(0)
  • 2021-01-18 00:42

    Frederic's proposal solved my problem: howto get rid off the white border in a fullscreen slideshow for safari browser. Perfect! Many thanks, wimsch [Since I couldn't add a comment on his answer [[< 50]]: I put it here to let him know my gratitude]

    0 讨论(0)
  • 2021-01-18 00:45

    try this

    <iframe src="....." style="position:absolute;"></iframe>
    
    0 讨论(0)
  • 2021-01-18 00:50

    I ran into a similar problem: I had the iframe inside a figure tag, and there was some white space between the iframe and the figcaption element.

    <figure>
      <iframe></iframe>
      <!-- white space was here -->
      <figcaption></figcaption>
    </figure>
    

    In my case simply adding iframe { display:block } solved the issue.

    0 讨论(0)
  • 2021-01-18 00:54

    Simply add style="margin: 0 0 0 0" inside <iframe > tag.

    example:

    <iframe src="http://www.yahoo.com" style="margin: 0 0 0 0"></iframe>

    If you want margin, you must add 'px' after number

    (Thanks to "Inspect Element" tool of Safari Browser) this solved my solution.

    0 讨论(0)
  • 2021-01-18 00:57

    Apply below to iframe

    display: block
    
    0 讨论(0)
提交回复
热议问题