Margin , width ghost (google iframe)

Asked

Viewed 72 times

0

Dear, hello. I am developing a website , but there is a margin or width that is not stated on the website that is disturbing your view. When making a test in inspecting element I came across some frames declared by google and saw that it is they who are doing this margin. The following 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>
  • Describe your problem better. Post an image of the screen, the element to which this iframe is inserted... something that can be analyzed. Does this iframe add something to your layout? If not, try adding the attributestyle="display:none;" to the iframe element, as some google iframes should only be on the page, not necessarily visible.

  • An example link : http://imgur.com/BktXNyf. This code appears at the end of the body where I did not state it in the initial code. When I delete by inspecting element on google, delete, but I have to find where declared function to be able to delete.

  • You are using some platform like joomla, wordpress, Magento...?

  • No, I developed normally, without using any CMS

  • Have you added any third-party code? See if my answer below resolves.

  • Usage, a plugin called youmax.js that imports youtube videos to be shown on my site. It is generating this authentication code. I want to see how to get the css properties out of it

Show 1 more comment

2 answers

0

If you’re using some CMS, e-commerce platform or something, then somewhere this code is being generated, and sometimes it’s hard 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.

  • It worked, but unfortunately affected the layout, removing the scrollbar for the other sessions of the site, so it became unviable

  • I changed the block. Check the answer again and try with this new block!

  • I found out which jquery was emerging this margin. It is a plugin calling youmax.js that uses youtube(google) authentication coming up the field "oauth2relay408099084".

0


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

Example :

html {

width:100%;

overflow-x: Hidden;

}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.