Forum Moderators: not2easy

Message Too Old, No Replies

"mapping" CSS?

         

cperkins

8:59 pm on Nov 4, 2003 (gmt 0)

10+ Year Member


I know how to switch style sheets to change the look, but how about "mapping" them?

Explanation: I have some CSS layouts. One is two columns and for a "content" and "left_sidebar" DIV. Example: #content { ... } #left_sidebar { ... }
Another layout is for "column1" "column2" and "column3". And a third layout is for "header" "main" "footer".

And I have some HTML pages. One page has some DIVs with ids like "article" "stats" "summary". And another "title" "links" "jeremy". Etc.

I could go through either the HTML or the CSS files and make the DIV ids and classes match up. But I'd really prefer a solution where I did not have to edit these. Is there anyway to specify (perhaps in a third CSS file) that the "jeremy" DIV should use the "content" CSS style?

It might be fun to be able to do this interactively, and I'd appreciate any leads on that. But my primary use would have to be the mapping without using any javascript.

Thanks,

Chris Perkins

P.S. I know I can do this with XSLT, but thats outside of scope right now.

DrDoc

9:04 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World!

I'm afraid this can't be done using CSS. However, you can always use PHP or some other scripting language to do this on the fly.

However, I recommend making changes to the IDs and class names in the HTML documents.