Problems with W3C Validation - Post...

User 407558 Photo


Registered User
36 posts

Hi guys,
I am having a problem validating my CC form. W3C returns the error "Bad value 100% for attribute width on element iframe: Expected a digit but saw % instead".
The line in the CC code is:
<iframe width="100%" height="588" style="border:none; background:transparent; overflow:hidden;"

The form can be viewed at http://www.brandxperts.co.uk/contact/index.html
Anyone have a solution?
Cheers,
Paul.
User 187934 Photo


Senior Advisor
20,271 posts

I just ignore it.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 407558 Photo


Registered User
36 posts

I'd love to since everything works well BUT I have a client insisting upon W3C validation!!
Clients eh? Can't live with them, can't shoot them.
Is there a solution?
User 187934 Photo


Senior Advisor
20,271 posts

Drop the iframe. Set the iframe width with px.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 1948478 Photo


Senior Advisor
1,850 posts

Move the percentage width from the html tag to the in-line style:

Change this line (#105):
<iframe width="100%" height="588" style="border:none; background:transparent; overflow:hidden;"

to this:
<iframe height="588" style="border:none; background:transparent; overflow:hidden; width:100%;"

then it will validate...
User 407558 Photo


Registered User
36 posts

Brilliant and so simple.
Thank you very much.:D
User 1948478 Photo


Senior Advisor
1,850 posts

You are most welcome :)

For consistency and general 'neatness', you may want to move the 'height' also to the css, making the line as follows:

<iframe style="width:100%; height:588px; border:none; background:transparent; overflow:hidden;"
User 187934 Photo


Senior Advisor
20,271 posts

That a great solution Per. That one escaped me for some reason. I use that on some JQuery dynamic iframes. Thanks for the reminder.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.