You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
According to "Accessible XHTML and CSS Web Sites", In the CSS section it says one may use tables for displaying tabular data but not for controlling page layout. Later in the accessibity section it says that pages should be designed so that even if the style sheet is not available, the page should be presented in a logical order.
If one doesn't use tables for layout, as far as I know, one needs to make extensive use of the position property. However, do that and the page looks pretty horrid without the style sheet. If one instead uses tables to control layout, the page still looks pretty readable when the style sheet is removed.
So how does one achieve both of these goals at the same time?
Yes, that is what I'm referring to. I've got a small page with a couple columns of rectangles representing the layout of a work area with who is working where. I'm using a bunch of position: absolute; DIVs to position these rectangles. It looks great with the linked style sheet but it doesn't follow the rule of being readable or layed out logically if you remove the style sheet.
By your response it sounds like there's a more appropriate way to do this using something other than DIVs and SPANs. What would that be? And maybe using a TABLE would be OK here, although it isn't really what I would call traditional tabular data.
Yeah. Use DIVs mainly to build "sections" that CSS can use to layout the page. Like #header, #footer, #nav... or whatever you prefer to call them. Use SPANs as a little as possible.
Use proper structural elements wherever you can. H1,H2,H3,P, BLOCKQUOTE, UL and so on. It won't be pretty without CSS but it will be very easy to read.
Here's a favorite of mine from a few years back. The colors are so tasteful. I could never do something like that myself. I think Disney formed my color sense. Disable style sheets and see what I mean. http://www.cinnamon.nl/