Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: If Frames Are Obsolete in HTML5, What Is A Good Alternative?  (Read 25677 times)

0 Members and 1 Guest are viewing this topic.

Aegis

    Topic Starter


    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
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!


"For you, a thousand times over." - "The Kite Runner"

camerongray



    Expert
  • Thanked: 306
    • Yes
    • Cameron Gray - The Random Rambings of a Computer Geek
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Mac OS
Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
« Reply #1 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?

Aegis

    Topic Starter


    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
« Reply #2 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


"For you, a thousand times over." - "The Kite Runner"

Aegis

    Topic Starter


    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
« Reply #3 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 ::)


"For you, a thousand times over." - "The Kite Runner"

camerongray



    Expert
  • Thanked: 306
    • Yes
    • Cameron Gray - The Random Rambings of a Computer Geek
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Mac OS
Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
« Reply #4 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]

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
« Reply #5 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!
I was trying to dereference Null Pointers before it was cool.

Aegis

    Topic Starter


    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: If Frames Are Obsolete in HTML5, What Is A Good Alternative?
« Reply #6 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 )


"For you, a thousand times over." - "The Kite Runner"