Question

I am working on a responsive site and I want to place in several ad banners from Google. As the layout is flexible and fluid, the banners' width and height should scale down and adapt to the parent elements that are defined relatively.

The problem is that the Google banners are loaded with some deprecated attributes within the img tag such as width and height.

Is there any method to ignore these attributes so that the Google banners get matched to the fluid layout and do not break out?

Thanks in advance.

Was it helpful?

Solution

The reason why Google uses these deprecated attributes is to hinder people to scale down ads that are to be shown in a pre-defined size. I think it even violates the TOS to scale them down, but I'm not sure.

In any case, you would have to load the image code with Ajax first, maipulate the attributes (remove them) and then insert the image. I don't know if this is possible, but I think you should not do it. Maybe switch to textual ads instead?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top