简介:范文网小编为你整理了多篇相关的《通讯类新闻范文(25篇)》,但愿对你工作学习有帮助,当然你在范文网还可以找到更多《通讯类新闻范文(25篇)》。
通讯类新闻范文 第1篇
深入理解CSS3结构伪类选择器
摘 要:本文从结构伪类与类选择器的比较、结构伪类与文档树的关系、结构伪类的功能与应用等三个层面,深入阐述了结构伪类的作用,结构伪类所表示的文档树结构,结构伪类通过位置索引定位子元素的机制。通过将定位子元素的结构伪类分为带参数和不带参数两类,深入论述了带参数结构伪类的参数模式、典型应用及与不带参数结构伪类的对应关系。
关键词:选择器;结构伪类;文档树;位置索引
中图分类号:TP391 文献标识码:A
Abstract:The article describes deeply the function of the structural pseudo-classes,the document tree structure represented by structural pseudo-classes and structural pseudo-classes mechanism of positioning sub-element by means of position index from the aspects of the comparison of the structural pseudo-classes and class selectors,the relationship of the structural pseudo-classes and the document tree as well as the functions and applications of the structural article discusses in detail the parameter model and typical application with parameter structural pseudo-class,the corresponding relations between structural pseudo-class with and without parameters by dividing the structural pseudo-class of positioning sub-element into two classes with and without parameters.
Keywords:selectors;structural Pseudo-classes;document tree;position index
1 引言(Introduction)
2 结构伪类与类选择器(Structural pseudo-classes and class selectors)
使用类选择器匹配元素
为选择第一个列表项和最后一个列表项,首先须在文档源代码中给它们添加类名,然后在CSS代码中用类选择器匹配元素。示例代码如下:
HTML代码:123
CSS代码:
/*通过类选择器匹配第一个列表项*/
{background-color:red;}
/*通过类选择器匹配最后一个列表项*/
{background-color:red;}
如果插入或追加列表项,则第一个或最后一个列表项会发生改变,所以,类名也要作相应变动,这给代码维护带来了极大的困难。
使用结构伪类匹配元素
结构伪类在插入或追加列表项时,文档源代码无须做任何改变,它也总是可以匹配到发生改变后的第一个和最后一个列表项。示例代码如下:
HTML代码:123
CSS代码:
/*通过结构伪类匹配第一个列表项*/
li:first -child{background-color:red;}
/*通过结构伪类匹配最后一个列表项*/
li:last-child {background-color:red;}
从以上比较可知,使用类名会改变文档源代码,而且,当项目变化时,还须手动维护类名,即元素的类名的获得是静态分配的;但使用结构伪类,不仅无须改变文档源代码,而且自动跟踪项目系列的序号变化,使元素定位更为准确、高效[2]。也就是说元素的结构伪类可以动态的获取和失去。
…… 此处隐藏20951字,全部文档请下载后查看。喜欢就下载吧 ……
通讯类新闻范文(25篇)




该篇《通讯类新闻范文(25篇)》范文为DOC格式,范文网为全国知名范文网站,下载本文后稍作修改便可使用,即刻完成写稿任务。网址:https://www.zhsm.net/a/c5gnqxr.shtml
上一篇:广播新闻报道范文(实用36篇)