4 ms·
Fun fact: this does work with iframes: <ul> <li><a href="about.html" target="display">about</a></li> <li><a href="contact.html" target="display">cont
by masswerk 1y ago
Fun fact: this does work with iframes:
<ul>
<li><a href="about.html" target="display">about</a></li>
<li><a href="contact.html" target="display">contact</a></li>
</ul>
<iframe src="about.html" name="display"></iframe>
The important part is that the target iframe must have a `name` attribute (not identified by `id`.) I guess, this is a legacy of framesets & frames.
(Of course, this has all the issues of framesets, as in deep linking, accessibility, etc.)
- charrondev 1y agoThe worst part of frames is scrolling. You have to give an iframe a specific height in pixels. There is no “make this iframe the height its content wants to be (like normal HTML). This leads to two options: - your page has nested vertical scroll bars (awful UX) - you have to write JavaScript inside and outside the frame to constantly measure and communicate how tall the frame wants to be. Or you could just not use frames.
- masswerk 1y agoI guess, the best you could do is emulating a frameset layout with a fixed navigation and a display frame for the actual content. (By setting the overflow to `hidden` you can get rid of the outer scrollbars.)