Hacker News new | past | comments | ask | show | jobs | submit login

Funny thing is that it still easier, even today, to use a frameset rather for header, sidebar and main area rather than fiddle with the new grid system.



Use position: absolute; or position: fixed; for both header and sidebar. Main area gets margin as big as header and sidebar. No framesets needed. That's at least what I did in 2001 and it worked like a charm. Even matching background elements of header and sidebar without any gaps.


Are framesets even supported in modern browsers? They have been removed from the html standard.


They are still supported and works perfectly fine still. Remember that browsers supports different DOCTYPEs (HTML5, XML, HTML4 strict and non strict etc) and they are not going away anytime soon, probably thousands and thousands web sites out there that doesn't implement HTML5 and never will.

Frameset is deprecated in HTML5, but your index page can be of the older frameset DOCTYPE and each frame valid HTML5 page with a <!DOCTYPE html> declaration. This is why frames (and iframes) are actually great because you can mix old an new.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" 
      "http://www.w3.org/TR/html4/frameset.dtd">
    <html>
    <head>
        <title>My page</title>
    </head>
    <frameset cols="100%" rows="10%,*,10%">
        <frame name="header" src="header.html">
        <frameset cols="20%,80%" rows="100%">
            <frame name="sidebar" src="sidebar.html">
            <frame name="main" src="main.html">
        </frameset>
        <frame name="footer" src="footer.html">
    </frameset>
    </html>

e.g main.html

    <!DOCTYPE html>
    <html>
        <head>
            <title>main</title>
        </head>
        <body>
            main
        </body>
    </html>


AFAIK no browser use the doctype for anything except for triggering quirks or standard rendering mode in css rendering.

But looking at MDN it seems you are correct, all mainstream browsers still support framsets.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: