2013年11月24日

CSS学习.1(child,display,position)

摘要: 伪类中的first child:在CSS中,如果采用这样的selector: p:first-child,那么其后面的部分只会对html代码中所有sibling中最靠前的p起作用。而如果采用这样的selector: p:nth-child(n),那么在同级的p标签中,第n个标签会受到CSS的影响。例如这样的代码:p:first-child { font-family: cursive;}p:nth-child(2){ font-family: Tahoma;}p:nth-child(3){ color: #CC0000;}p:nth-child(4){ backgrou... 阅读全文

posted @ 2013-11-24 23:14 清水老和尚 阅读(247) 评论(0) 推荐(0) 编辑

CSS学习.0(基础知识,一般格式,class,id

摘要: 在html中链接CSS的方式:link type="text/css" rel="stylesheet" href="stylesheet.css"另外也可以在html的head标签中添加style标签来定义,不过这样就失去了把内容和表现分开的功能。CSS中一般格式为:selector { property: value;}注意,在CSS中,定义的每一行结尾都是带有分号的!selector的内容可以是p,img,table等等等等,property可以是font-family,font-size这些内容,value自然就是proper 阅读全文

posted @ 2013-11-24 21:28 清水老和尚 阅读(172) 评论(0) 推荐(0) 编辑

导航