Computer Hope

Internet & Networking => Web design => Topic started by: Aegis on June 21, 2016, 02:56:59 PM

Title: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
Post by: Aegis on June 21, 2016, 02:56:59 PM
If Frames Are Obsolete in HTML5, What Is A Good Alternative?

I've read a little about Inline Frames, but it makes it seem like the iFrame is meant to accept/run an embedded (separate) web page.

Will iFrames allow elements like lists, etc.?

Is there a way to "frame" elements on a page via iFrames, or should I be looking at other commands?

Thanks!
Title: Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
Post by: camerongray on June 21, 2016, 03:11:42 PM
Yes, iFrames are designed to embed external web pages into a page.  They aren't obsolete but traditionally people have used them for incorrect things like navigation panes which shouldn't be done nowadays.  What are you trying to accomplish?
Title: Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
Post by: Aegis on June 21, 2016, 03:24:43 PM
Cameron:
Thank you for your reply. I will try to make you not regret it!  ::) ;D

I am currently trying to edit dblsolution.com/contact.html to get rid of the white space to the right of the contacts list. I thought, silly me, that I could "frame" the contact list, and then frame the accordion of the questions, side by side.

I am playing with the iFrames command on a test page, just to see what I can determine.

Appreciated, Brian
Title: Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
Post by: Aegis on June 21, 2016, 03:49:45 PM
<iframe height="200" width="300"></iframe>
<iframe height="200" width="300"></iframe>
 

Subsequent lines of code generate two frames, side by side.

If I had a brain, I'd be dangerous!  ;D ::)
Title: Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
Post by: camerongray on June 21, 2016, 04:23:20 PM
Frames shouldn't be used for layout - For what you are doing you should be using CSS to adjust the style.  For example, the accordion element has a CSS attribute of "margin-left: 20%;" applied which is causing the gap to appear, removing this attribute or overriding it by setting "margin-left: 0" would solve it as seen in the attached screenshots.

[attachment deleted by admin to conserve space]
Title: Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
Post by: BC_Programmer on June 21, 2016, 05:57:32 PM
Generally, yes, CSS is how you would do this sort of thing now. Arguably it can be a bit more obtuse but it's typically more flexible.

Also, Good to see you again, been almost 4 years since your last post!
Title: Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
Post by: Aegis on June 21, 2016, 06:12:54 PM
Dear Cameron:

It seems you CAN teach an old dog new tricks!  ;D Well, maybe...  ::)

I understood the concept that the style sheet drives the element, but it never occurred to me to check the margin settings! Then, my next thought was, how in the nine circles of Hades did he find that so damned fast?! I couldn't admit I couldn't find it, so I stumbled around, until I tripped over it, picked myself up, dusted myself off, and exclaimed, "Aha! A clue!"

Through much trial and error, I reduced the margin setting from 20% to 13%, and it worked -- in spite of my best efforts!

Cameron, I really appreciate the help! I'm going to have to spend more time on the CSS, since there are other details I want to tweak.

BC_Programmer: Greetings! Not up on the hardware and OS stuff, like once I was, so I drop in every so often, but really haven't contributed.

You are quite right about the CSS: changing the margin setting for the accordion element has it centered on one page, but has caused an accordion on another page to become off-center. It's good for now. The difference on the other page is not that important.

You'll probably see me post more questions in Web Design...also in Linux. I'm probably going to bail on Windows 10 in favor of OpenSUSE. (Stop laughing, Cameron.  ;D )