Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

When I validate this page, I'm getting kind of these errors:

Error Line 161, Column 438: The scrolling attribute on the iframe element is obsolete. Use CSS instead.

…95,0.023378&z=14&output=embed">

✉ Error Line 161, Column 438: The marginheight attribute on the iframe element is obsolete. Use CSS instead.

…95,0.023378&z=14&output=embed">

✉ Error Line 161, Column 438: The marginwidth attribute on the iframe element is obsolete. Use CSS instead.

…95,0.023378&z=14&output=embed">

✉ Error Line 179, Column 477: The frameborder attribute on the iframe element is obsolete. Use CSS instead.

…=40.566625,-3.261292&output=embed">

✉ Error Line 179, Column 477: The scrolling attribute on the iframe element is obsolete. Use CSS instead.

…=40.566625,-3.261292&output=embed">

✉ Error Line 179, Column 477: The marginheight attribute on the iframe element is obsolete. Use CSS instead.

…=40.566625,-3.261292&output=embed">

✉ Error Line 179, Column 477: The marginwidth attribute on the iframe element is obsolete. Use CSS instead.

…=40.566625,-3.261292&output=embed">

Is there any way to get a Google Maps link with that erroneous code?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

This has been discussed here: http://www.webdeveloper.com/forum/showthread.php?261932-google-maps-iframe-error-on-validation There are two proposed solutions.


Eye for Video says:

A few errors will mean little compared to the page content and the number and quality of inbound links. But if you want, just edit the <iframe> code by hand. You can remove those attributes and style as needed. Those attributes are just styling issues anyway. This is just an issue with HTML5, not lower versions.


jedaisoul says:

There is an alternative, which would solve this, do not use an Iframe. If you look carefully at the code Google supply for the map, it actually breaks into two links:

  1. The active link that is automatically displayed in the Iframe.
  2. A link to display a larger map, which is not displayed in the Iframe.

What I do is:

  1. Initially use the code as given, and capture the map display using Print Screen. This can be pasted in your favourite graphic editor, optimised, and written to a JPG.
  2. I then substitute an <IMG> displaying the jpg file for the Iframe.
  3. I leave the second call to Google Maps, so people can still access a scrollable, zoomable, active image if required.

This has the additional benefit that the load time for my page is not dependent on a response from Google Maps, which can sometimes be slow. If you want to see what I mean, this site has two Google maps on the home page, which is something I would not recommend you do with live links to Google Maps, particularly on a home page!!! Incidentally it is also an example of how, using fluid design techniques, you can design and structure a site to be viewable on screens from 320 pixels wide upwards. But that is another story...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.