我使用的是Visual Developer 2008 Express Edition
stylesheet.css中
body {
font-size: 12px;
color: blue;
font-family: arial, helvetica, verdana, sans-serif;
text-decoration: underline;
}
.button{
font-weight: bold;
font-size: 14px;
color: red;
background-color: yellow;
font-family: arial, helvetica, verdana, sans-serif;
}
.label{
font-weight: bold;
font-size: 18px;
color: green;
font-family: arial, helvetica, verdana, sans-serif;
}
CssDemo.aspx
当我在浏览器(IE 10)中查看CssDemo.aspx时,我得到了
为什么CSS中没有.button和.label覆盖主体?
答案 0 :(得分:3)
在CSS中,.
表示HTML中的类,如果要直接设置标记样式,请将该点留在CSS中。
button {...}
label {...}
或使用您的ID
#Button1 {...}
#Label1 {...}