Margin, width ghost (google iframe)

0

Expensive, hello. I'm developing a website, but there is a margin or width that is not declared on the site that is disrupting your view. When doing a test in the inspect element I came across some frames declared by google and I saw that they are doing that margin. Here is an example of the code described.

<iframe name="oauth2relay1380469440" id="oauth2relay1380469440" src="https://accounts.google.com/o/oauth2/postmessageRelay?parent=http%3A%2F%2Flocalhost&amp;jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.pt_BR.LGFZ9cC0bWM.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCMsrVkC5z6iTSQ0Ly8uCy_z20NJnw#rpctoken=722483838&amp;forcesecure=1"tabindex="-1" style="width: 1px; height: 1px; position: absolute; top: -100px;"></iframe>
    
asked by anonymous 04.04.2016 / 21:09

2 answers

0

Well, I solved this problem by putting the css property in the html for "overflow-x: hidden;" ignoring anything that might leak.

Example:

html {

width: 100%;

overflow-x: hidden;

}

    
06.04.2016 / 14:03
0

If you're using some CMS, e-commerce platform or something, then somewhere this code is being generated, and sometimes it's tricky to figure out where.

Try adding the block below in your document:

<script>
$(document).ready(function(){
  $('body iframe').css('margin', '0px');
  $('body iframe').css('padding', '0px');
  $('body iframe').css('width', '0px');
  $('body .main').next().css('margin', '0px');
  $('body .main').next().css('width', '0px');
  $('body .main').next().css('padding', '0px');
});
</script>

This code will only remove the margins and width of the code, but it will still be generated.

    
05.04.2016 / 14:01