• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / HTML And CSS / Google remarketing tag iframe height issue

Google remarketing tag iframe height issue

Google’s remarketing code inserts an iframe (with no content) directly below the opening <body> tag, which is 300x13px and can throw out a website’s layout. This post looks at how to effectively hide it with CSS in a couple of different ways that hopefully shouldn’t mess with its functionality at all.

Using position: absolute

Add this to your CSS and it will use absolute positioning, pushing it off the left side of page so it cannot be seen and doesn’t affect content flow:

iframe[name='google_conversion_frame'] {
    position: absolute;
    left: -1000px;
}

Setting the height

Another method is to set the height instead:

iframe[name='google_conversion_frame'] {
    height: 0;
}

I’ve seen posts that suggest setting display: block as well, but just setting the height seems to work OK. If you find it’s not setting the hide in a particular browser, then try adding display block too.

Setting display: none?

This will work to hide the frame, but it’s probably not a good idea because it may mess with the functionality of the remarketing code. Obviously the above options may too, but something needs to be done to prevent it from pushing layouts out.

Check Out These Related posts:

  1. HTML/CSS background-position
  2. Using CSS sprites for image navigation
  3. Show and hide an element with jQuery
  4. Float a div over a YouTube iframe

Filed Under: HTML And CSS

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap