What's the best thing for layouts?

vieya

New Member
What's the best type of layout. I've used div, table, css, javascript, frames, iframes to design layouts. I was wondering since for me it feels like using iframes is the easiet. I've tried using div but I was wondering if for tables and Divs would i have to design every page over? That's basically what I've been doing when I do webpages. I would design a page over and over? I guess I"m still a beginner even after all these years.
 

codeguardian

New Member
I prefure using tables as they are supported by all browsers. But I am old school. There are definitly situations when DIV positioning can be better. But, I see all the time DIV positioning not work in some situations even with the BIG websites like yahoo and so many more.
 

ben123

New Member
The 'best' way to code layout is using divs, not tables. Tables should only really be used for tabular data like a timetable. All layout should be done using a css stylesheet which will define how all the page elements (divs, spans, lists etc) will appear. There are a number of benefits to using css for layout rather than tables:

1 - less code, making it easier to update pages
2 - 1 css file for layout so in theory you can chnage the layout of an entire site simply by chnaging the css file
3 - Logical source order, better for people using screen readers
4 - Easy to create different versions of the site for different devices. All you need to do is create a separate css file for each type of device you want a different layout for e.g. printer, mobile phone

You mentioned iframes and I guess you're using these for templated items. 2 alternatives would be to use SSI (server side includes, should be supported on any host) or php/asp includes if your hosting allows. Both methods allow you to 'include' files in a page, for example you could have 1 file containing the navigation and use SSI or php/asp includes to include the navigation on every page of your site.
 

vieya

New Member
oh okay. so with ssi and php/asp I can keep the navigation on every page without coding it on every page?
Would this be the same as if for example clicking on a link would go to a page with the same navigation put just different content? What I'm trying to say is would it be like loading the a whole new page even though the navigation is the same but content is different? Or would it only load the content?
 
Top