在设计/更改页面布局时,我需要根据需要为每个div / class元素着色。这使我可以清楚地看到布局的结构。
在用实际内容测试/呈现页面布局时,我有不同的配色方案。
我需要经常在两者之间切换。我该怎么做?
请帮忙。
最佳答案
在测试时,您可以将类添加到html
或body
标记中
例如<html class="testingMode">
然后在样式表中可以覆盖其他样式
例如
/*Normal/Live mode*/
.divClass {
background: none;
}
/*Testing mode*/
.testingMode .divClass {
background: green;
}
在上线之前,您可以从
testingMode
标记中删除html
的类,并且那些覆盖的样式将不会应用。