Iframes in HTML
 

Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop

[Closed] Iframes in HTML

20 Posts
8 Users
0 Reactions
55 Views
Posts: 91096
Free Member
Topic starter
 

Are they bad now?


 
Posted : 16/06/2011 3:42 pm
Posts: 251
Full Member
 

yes.


 
Posted : 16/06/2011 3:42 pm
Posts: 91096
Free Member
Topic starter
 

Why?


 
Posted : 16/06/2011 3:44 pm
Posts: 251
Full Member
 

bad for SEO, navigation, useability. also havign a fixed thing on apage causes problems on mobile devices etc.

are you tryign to include pages from external sites with your own wrapper on it or something?


 
Posted : 16/06/2011 3:50 pm
Posts: 31206
Full Member
 

AFAIK they are okay - certainly used extensively on sites I see anyway. They break the whole HTML=content CSS=style paradigm a bit, but that's commonly broken anyway.


 
Posted : 16/06/2011 3:50 pm
Posts: 4337
Free Member
 

What are you trying to achieve?

some presentation aspects of iframes can be done with divs and positioning


 
Posted : 16/06/2011 3:51 pm
Posts: 0
Free Member
 

Still supported in HTML 5. There are better ways of including dynamic content if that's what you are trying to do.

Hidden iframes are still common - even Google uses them.


 
Posted : 16/06/2011 3:54 pm
Posts: 31206
Full Member
 

bad for SEO, navigation, useability

Aren't you thinking of frames?

havign a fixed thing on apage causes problems on mobile devices etc.

I count 3 iframes on the STW forum page and it works fine on my phone.
Why would they need to be "fixed on a page"? They are just blocks.


 
Posted : 16/06/2011 3:55 pm
Posts: 251
Full Member
 

this is a cut'n'paste I'm afraid but does give the reasons why I prefer my developers to avoid them;

They are not web standards compliant.
They will cause massive issues for blind or inaccessible users, relying on screen-readers and keyboard navigation only.
Content in the iFrame will be treated as a separate page by the search engines.
iFrames don’t work in all browsers. – Therefore we need to make additional versions of the site to accommodate these users. ( Extra work, extra time and cost)
Very bad practice for Search engine optimisation
Complicates any ‘Print this page’ scripts.
Users are not used to having multiple scrollbars. Also when using the mousewheel to scroll, browsers get confused as to whether you are scrolling the main page or the internal scrolling page inside the iFrame.
iFrames promote the use of invalid HTML/XHTML. – Pages wont validate – meaning they are not W3C compliant and wont work on all modern browsers and screen readers ( accessibility)
Very difficult to do bookmarking, printing and navigation
iFrames slow down the website.
Without scripting, they tend to break the “previous page” functionality offered by browsers. – ie you cannot use the ‘Back button’ on your browser.


 
Posted : 16/06/2011 3:57 pm
Posts: 10340
Free Member
 

Seen as pretty bad, but then they're still used by nearly everyone who has a facebook 'like' button or 'Add this' bar on their sites.

I would say don't use them for anything that is important content that belongs to your site. Then only use them if there's no other way to achieve what you want.

edit: I see there's been a more thorough post above 🙂


 
Posted : 16/06/2011 3:57 pm
Posts: 0
Free Member
 

I count 3 iframes on the STW forum page

I haven't looked but at a guess that's for the ads ?


 
Posted : 16/06/2011 3:58 pm
Posts: 10340
Free Member
 

yes, on this page, the iframes are all for the ads


 
Posted : 16/06/2011 4:00 pm
Posts: 31206
Full Member
 

wwaswas: hmm some interesting points.

They are not web standards compliant.. use of invalid HTML/XHTML. – Pages wont validate – meaning they are not W3C compliant

How are they not valid HTML?

They are in HTML4.01: http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#h-16.5

And in the HTML5 proposal: http://www.w3.org/TR/2011/WD-html5-20110525/the-iframe-element.html#the-iframe-element


 
Posted : 16/06/2011 4:09 pm
Posts: 4337
Free Member
 


They are not web standards compliant.

wrong? How so? they validate?

They will cause massive issues for blind or inaccessible usersrelying on screen-readers and keyboard navigation only

again, wrong. In my experience screenreader users get on just fine as long as they are titled correctly

iFrames don’t work in all browsers. – Therefore we need to make additional versions of the site to accommodate these users. ( Extra work, extra time and cost)

hello 1999.. Which modern browser doesn't support iframes?

iFrames promote the use of invalid HTML/XHTML. – Pages wont validate – meaning they are not W3C compliant and wont work on all modern browsers and screen readers ( accessibility)

No they don't!..


 
Posted : 16/06/2011 4:18 pm
Posts: 91096
Free Member
Topic starter
 

are you tryign to include pages from external sites with your own wrapper on it or something?

The current page is static content with two levels of nested iframes. Pointless - perhaps, although I think the original author did it for layout reasons.

However the bottom level (which is about 1/4 of the screen) is going to be replaced with dynamic content, by me, and the rest of the page tidied up.

The top two levels can be merged, I'm fairly sure of that. But how best to include a dynamic section in a static page?

It's an application that gets rolled out to specific customers, so although it's accessible via the public net, search engine visibility is not an issue.


 
Posted : 16/06/2011 6:06 pm
Posts: 1680
Full Member
 

DIV and some ajax is how it's done nowadays.

I used to love iframes me.


 
Posted : 16/06/2011 6:15 pm
Posts: 251
Full Member
 

trickydisco - I did say it was a cut'n'paste, I didn't read it in detail - was just trying to make the point that iframes (whilst they may be syntactically allowed) are, by and large, being avoided by most developers 'these days'.


 
Posted : 16/06/2011 6:20 pm
Posts: 91096
Free Member
Topic starter
 

Ajax? Sod that.


 
Posted : 16/06/2011 6:24 pm
Posts: 1680
Full Member
 

Everytime someone needlessly uses an iframe or make a tables based layout, someone else installs IE6.

You've already done it in an iframe haven't you?


 
Posted : 17/06/2011 7:54 am
Posts: 91096
Free Member
Topic starter
 

I'm editing someone else's HTML and deciding whether or not to bin the existing iframes.


 
Posted : 17/06/2011 8:42 am
Posts: 6208
Full Member
 

or make a tables based layout

Jeez - don't look at VBulletin generated HTML! That has more nested tables than an Ikea warehouse.

I'll only use iframes for things like importing a google calendar, map etc. where that's the source the generate for embedding.


 
Posted : 17/06/2011 10:53 am