【发布时间】:2015-12-08 07:14:00
【问题描述】:
我有 5 个 CSS 类。除了一行之外,它们完全相同。有没有办法创建一个 CSS 类,然后让其他 5 个 CSS 类从该类继承,然后添加它自己的特定类?
正如您在下面看到的,唯一不同的是这一行...
背景图片:url("../Images/vertTabsButton2.gif");
.divMasterCol1Button1 {
float: left;
border-style: none;
border-width: thin;
background-image: url("../Images/vertTabsButton1.gif");
background-repeat: no-repeat;
background-position-x: center;
background-position-y: top;
width: 215px;
height: 700px;
margin: 0px auto;
padding: 0px;
text-align: center;
}
.divMasterCol1Button2 {
float: left;
border-style: none;
border-width: thin;
background-image: url("../Images/vertTabsButton2.gif");
background-repeat: no-repeat;
background-position-x: center;
background-position-y: top;
width: 215px;
height: 700px;
margin: 0px auto;
padding: 0px;
text-align: center;
}
【问题讨论】:
-
使用标准 CSS 规则,见我的帖子。
标签: css