PDA

View Full Version : Mixed CSS class and ID in DW template


CyberCrone
06-28-2009, 06:32 PM
I am using a template provided by DW, the two column liquid with header and footer. The provided code in the template has CSS in this form: .twoColLiqLtHdr #container {...}. I am a beginner with CSS and don't understand this setup.

I do see that the class is set up with <body class="twoColLiqLtHdr"> but don't understand the necessity. Couldn't all those ID's be defined simply with #container, #sidebar, #header and so on, without the class? Or even as classes themselves?

I realize there must be a reason for this; I just need to understand it. I am the type that doesn't learn well unless I understand the reason for something.

DWcourse
06-30-2009, 05:33 AM
It's possible you could have a website with more than one page layout (say a tow column layout and a three column layout). Both layout could have a #container element and you might have #container styles that apply to all pages and other #container styles that apply only to one layout or the other. Using the .twoColLiqLtHdr #container format let you control which layout a style applies to. So:

.twoColLiqLtHdr #container - applies only to the 2 column layout
.threeColLiqLtHdr #container - applies only to the 3 column layout
#container - applies to both the 2 and 3 column layouts

CyberCrone
06-30-2009, 09:29 AM
It's possible you could have a website with more than one page layout (say a tow column layout and a three column layout). Both layout could have a #container element and you might have #container styles that apply to all pages and other #container styles that apply only to one layout or the other. Using the .twoColLiqLtHdr #container format let you control which layout a style applies to. So:

.twoColLiqLtHdr #container - applies only to the 2 column layout
.threeColLiqLtHdr #container - applies only to the 3 column layout
#container - applies to both the 2 and 3 column layouts

AHA! I'm waiting for my Dreamweaver: The Missing Manual to arrive. I trust all these mysteries will then be explained. But this one was puzzling me NOW. :confused: Thanks!