We have alternate text, alt
attribute, for an img
tag in HTML, which will show up when the image doesn't come up. I tried using the tag with iframe
too.
<iframe src="www.abc.com" alt="Web site is not avaialable">
But the alternate text doesn't come up when src=""
is given. Just wanted to know if I can achieve alternate text in any other way, if the src
is not given ?
While not the "cleanest" solution, another option is to use position and z-index in your CSS to "hide" an empty image under the iframe
. This will give you all of the meta-data advantages of true alt text without needing to go into any complex scripting.
It's also good if you just want it as placeholder to display until the iframe
is done loading.