Forum Moderators: open

Message Too Old, No Replies

Are Layers Acceptable?

layers should they be used or not

         

guitariststuff

11:54 am on Sep 28, 2007 (gmt 0)

10+ Year Member



I am making up tables for a webpage and some are quite complex especially if you start to add classes, ids and then from that the CSS attachements. Is it bad practice to use lots of layers to get the same result and not use CSS?

penders

12:10 pm on Sep 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is it bad practice to use lots of layers to get the same result and not use CSS?

What do you mean by, 'lots of layers'? I would have thought that the use of CSS should make your HTML markup a lot clearer and ultimately less complex?

...add classes, ids and then from that the CSS attachements.

What additional 'CSS attachments' are you adding, apart from Classes and Ids?

[edited by: penders at 12:30 pm (utc) on Sep. 28, 2007]

stever

12:12 pm on Sep 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The first thing to do, without getting into the mindnumbing discussions of whether tables or "layers" (actually "divs") are better or worse, is to learn a little bit more about what it is that you are using and why you are using it.

For example, you don't say whether you are using the tables for layout, for presenting content, for presenting tabular data, for presenting dynamic content, etc.

CSS can be used to style different parts of html, so it doesn't really matter if they are table elements or other elements, although the effects of applying CSS vary from element to element.

"Layers", speaking strictly technically, is a deprecated term in html code, but it was also used as a term for "divs" in certain software and is common usage for them. Just as people use tables quite happily and unnecessarily, so people can use divs quite unnecessarily where another element may be as or more appropriate ("div" just means a division of one part of a document).

If I were to guess, I would say that you are attempting to move from a table-based layout and are thinking of using absolutely-positioned divs to gain the same effects.

If this is the case, you would possibly be better off taking the time to learn more about CSS and modern CSS design - rather than plunging in and simply replicating table cells with layers.

Xapti

11:25 pm on Sep 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well put, Stever.

And guitariststuff, whether or not you use tables, you'll need to use CSS at least somewhat. Adding IDs and classes for stuff should make it MORE ORGANIZED, which ultimately makes things simpler and easier to manage.

What is somewhat "bad practice" is to be using tables for your complete webpage... like for layout. Tables should really only be used for displaying tabular data, as mentioned.
With new advancements in CSS, it is very easy to make well-fitting, dynamic, flexible web pages, using floating divs and other techniques.