---------------------- Windows Phone 7手机开发、.Net培训、期待与您交流! ----------------------
1:css(层叠样式表)三种嵌套方式,即元素内联,页面嵌入和外部引用。
元素内联:直接将样式写入元素的style属性中。
e-g:
<input type="text" style="background-color:red"/> 适用于样式没有可复用性的场合。
页面嵌入: 在head中加入
<style type="text/css">
input {border-color: yellow;color:red}
</style>
表示页面中所有input都是采用指定的样式,适合于样式复用,减小页面体积。
外部引用:将css内容写入css后缀的文件,然后在页面中引用,在head中加入<link type="text/css" rel="style sheet" href="StyleSheet.css" />
适合于多个页面共享css。
e-g:
添加一个StyleSheet.css样式表
input {background-color:Blue;
border-color: Green }
p{color:Gray}
<head>
<title>无标题页</title>
<link type="text/css" rel="Stylesheet" href="StyleSheet.css" >
</head>
<body>
<input type="text"/>
<p> aaaaa </p>
</body>
---------------------- Windows Phone 7手机开发、.Net培训、期待与您交流! ---------------------- 详细请查看:http://net.itheima.com/