Hi, I'm updating my site, which currently uses iFrames extensively. I've read everywhere about how iFrames are bad and outdated. What do I do instead? I haven't seen a single proper example of a "css frame", or i'm just not getting it. Say I have this code: Code: <iframe src ="News.html" align="middle" width="90%" height="200px" frameborder="1"></iframe> What would a CSS version of this look like? I need to be able to have a frame with links in it, and when I click the links, it will only open them in the frame.
CSS is used for styling elements. As such it doesn't really have a replacement element. What it does do is give you the flexibility to use and style things so that rather than using a table to display non-tabular data, you can instead use spans/divs and just positioning them exactly how you want. If you dno't want to use iframes, I guess you'd stick the contents of the iframe into a div. You can then either use some javascript to only update the html within that element when a link is clicked (read html file and stick contents in innerhtml attribute - stripping outany thing not in the 'body' tags), or alternatively reload the entire page and assuming it's all templated then getting the info in the div without changing the structure is simply done (probably most common method as it doesn't require js to be enabled, and the page should load quickly as bandwidth is not really an issue for most sites plus you can always cache things as needed).
Jeah.. .without delving into templating and Server side scripting, my recommendation would be somehting like jQuery/AJAX and DIVs. If you're comfy with Server side tech like ASP/.NET/PHP, i'd recommend using that. There's a couple of Ways you can do that from there. Master pages in .NET, xTemplate or similar in PHP. Also, loads of PHP frameworks out there that help with that (try Keepr for example)
Using javascript to hide and show (using CSS at runtime) isn't however. Hence my suggestion of jQuery.
Yes, it really is. You want to turn a whole website into a single, humongous page which can't be bookmarked? And it will look ridiculous to clients not interpreting CSS (i.e. the blind).