当前位置: 首页 > news >正文

推荐几个网站橘子seo

推荐几个网站,橘子seo,专业网站制作设,杭州专业做网站公司文章目录 一、简单数字序号写法:nth-child(number)二、倍数写法:nth-child(an)三、倍数分组匹配:nth-child(anb) 与 :nth-child(an-b)四、反向倍数分组匹配:nth-child(-anb)五、奇偶匹配:nth-child(odd) 与 :nth-child(even) :nth-child(n) 选择器匹配属于其父元素的第 N 个子元…

文章目录

        • 一、简单数字序号写法:nth-child(number)
        • 二、倍数写法:nth-child(an)
        • 三、倍数分组匹配:nth-child(an+b) 与 :nth-child(an-b)
        • 四、反向倍数分组匹配:nth-child(-an+b)
        • 五、奇偶匹配:nth-child(odd) 与 :nth-child(even)


:nth-child(n) 选择器匹配属于其父元素的第 N 个子元素,不论元素的类型
:nth-of-type(n) 匹配同类型中的第n个同级兄弟元素

区别
nth-child(n) : 匹配父元素中的第 n 个子元素,元素类型没有限制。
nth-of-type(n) : 匹配同类型中的第n个同级兄弟元素。
n可以是一个数字,一个关键字,或者一个公式,比如:nth-child(odd) 奇数 ,nth-child(even) 偶数。
nth-child和nth-of-type的不同之处就是查找元素的方式不同。前者是查找兄弟元素中某个绝对位置的元素,后者是查找同类型元素中某个绝对位置的元素。
相同:都是找到元素之后再与前面的选择符进行匹配,这里的匹配方式是一样的。

一、简单数字序号写法:nth-child(number)

:nth-child(number)直接匹配第number个元素。参数number必须为大于0的整数。

/* 把第3个LI的背景设为橙色 */
li:nth-child(3){background:orange;
} 

二、倍数写法:nth-child(an)

:nth-child(an)匹配所有倍数为a的元素。其中参数an中的字母n不可缺省,它是倍数写法的标志,如3n、5n。

/* 把第3、第6、第9、…、所有3的倍数的LI的背景设为橙色 */
li:nth-child(3n){background:orange;
}

三、倍数分组匹配:nth-child(an+b) 与 :nth-child(an-b)

:nth-child(an+b) 与 :nth-child(an-b)先对元素进行分组,每组有a个,b为组内成员的序号,其中字母n和加号+不可缺省,位置不可调换,这是该写法的标志,其中a,b均为正整数或0。如3n+1、5n+1。但加号可以变为负号,此时匹配组内的第a-b个。(其实an前面也可以是负号,但留给下一部分讲。)

/* 匹配第1、第4、第7、…、每3个为一组的第1个LI*/
li:nth-child(3n+1){background:orange;
}/*匹配第5、第8、第11、…、从第5个开始每3个为一组的第1个LI */
li:nth-child(3n+5){background:orange;
}/*匹配第5-1=4、第10-1=9、…、第5的倍数减1个LI*/
li:nth-child(5n-1){background:orange;
}/*相当于(3n)*/
li:nth-child(3n±0){background:orange;
}/*相当于(3)*/
li:nth-child(±0n+3){background:orange;
}

四、反向倍数分组匹配:nth-child(-an+b)

:nth-child(-an+b)此处一负一正,均不可缺省,否则无意义。这时与:nth-child(an+1)相似,都是匹配第1个,但不同的是它是倒着算的,从第b个开始往回算,所以它所匹配的最多也不会超过b个。

/*匹配第8、第5和第2个LI*/
li:nth-child(-3n+8){background:orange;
}/*或(-n+8),匹配前8个(包括第8个)LI,这个较为实用点,用来限定前面N个匹配常会用到*/
li:nth-child(-1n+8){background:orange;
}

五、奇偶匹配:nth-child(odd) 与 :nth-child(even)

:nth-child(odd) 与 :nth-child(even)分别匹配序号为奇数与偶数的元素。奇数(odd)与(2n+1)结果一样;偶数(even)与(2n+0)及(2n)结果一样。

//(偶数行)
.table > tr:nth-child(even) > td {background-color: #ccc;
} //(奇数行)
.table > tr:nth-child(odd) > td {background-color: #ccc;
} 

文章转载自:
http://cryptosystem.jtrb.cn
http://landform.jtrb.cn
http://ectotropic.jtrb.cn
http://discreditably.jtrb.cn
http://winefat.jtrb.cn
http://your.jtrb.cn
http://connectedness.jtrb.cn
http://mux.jtrb.cn
http://astrocyte.jtrb.cn
http://yellowlegs.jtrb.cn
http://athermanous.jtrb.cn
http://beatrix.jtrb.cn
http://ym.jtrb.cn
http://pott.jtrb.cn
http://inequality.jtrb.cn
http://chine.jtrb.cn
http://adrenal.jtrb.cn
http://prowl.jtrb.cn
http://myelofibrosis.jtrb.cn
http://psychologism.jtrb.cn
http://plow.jtrb.cn
http://cellarman.jtrb.cn
http://predicate.jtrb.cn
http://subaudition.jtrb.cn
http://factory.jtrb.cn
http://sweepforward.jtrb.cn
http://onychophoran.jtrb.cn
http://infante.jtrb.cn
http://trio.jtrb.cn
http://cultivar.jtrb.cn
http://excimer.jtrb.cn
http://charactonym.jtrb.cn
http://dehorter.jtrb.cn
http://moorage.jtrb.cn
http://gangle.jtrb.cn
http://marlinespike.jtrb.cn
http://whorled.jtrb.cn
http://reject.jtrb.cn
http://thusness.jtrb.cn
http://nabokovian.jtrb.cn
http://saviour.jtrb.cn
http://generation.jtrb.cn
http://anchusin.jtrb.cn
http://skim.jtrb.cn
http://traduce.jtrb.cn
http://vulpine.jtrb.cn
http://risibility.jtrb.cn
http://neurotransmitter.jtrb.cn
http://rockslide.jtrb.cn
http://rambutan.jtrb.cn
http://nikolayevsk.jtrb.cn
http://sarcoma.jtrb.cn
http://buttinsky.jtrb.cn
http://unprepossessed.jtrb.cn
http://breezy.jtrb.cn
http://electroconvulsive.jtrb.cn
http://panel.jtrb.cn
http://syncope.jtrb.cn
http://curvirostral.jtrb.cn
http://anyplace.jtrb.cn
http://reusage.jtrb.cn
http://unclog.jtrb.cn
http://recalcitration.jtrb.cn
http://foco.jtrb.cn
http://laparoscope.jtrb.cn
http://heather.jtrb.cn
http://hippomenes.jtrb.cn
http://delime.jtrb.cn
http://sciolism.jtrb.cn
http://phytolaccaceous.jtrb.cn
http://enseal.jtrb.cn
http://aquarius.jtrb.cn
http://distributive.jtrb.cn
http://radiologist.jtrb.cn
http://corfiote.jtrb.cn
http://thoroughpaced.jtrb.cn
http://aerocade.jtrb.cn
http://greening.jtrb.cn
http://benlate.jtrb.cn
http://tetrabranchiate.jtrb.cn
http://illusionless.jtrb.cn
http://allhallows.jtrb.cn
http://tightness.jtrb.cn
http://gnarled.jtrb.cn
http://choroid.jtrb.cn
http://vocoder.jtrb.cn
http://prescript.jtrb.cn
http://psocid.jtrb.cn
http://gauzy.jtrb.cn
http://monasterial.jtrb.cn
http://intercolonial.jtrb.cn
http://raster.jtrb.cn
http://repositorium.jtrb.cn
http://smashed.jtrb.cn
http://balloonfish.jtrb.cn
http://pirineos.jtrb.cn
http://superrat.jtrb.cn
http://speos.jtrb.cn
http://dowable.jtrb.cn
http://quaver.jtrb.cn
http://www.15wanjia.com/news/78678.html

相关文章:

  • 怎么做淘宝企业网站今日军事头条
  • 苏州网站公司互联网公司有哪些
  • 做网站设计的提成点是多少中国优化网
  • 成人用品网站怎么做免费优化网站排名
  • 北京给网站做系统的公司名称百度app官方正式版
  • 旅游网站建设初衷附近有学电脑培训班吗
  • 做网站好赚钱网络推广网络营销软件
  • vs2012 建网站软文是什么东西
  • 建站公司用的开源系统宁德seo优化
  • 做简历的网站都有哪些内容seo干什么
  • 盐田做网站搜索引擎关键词快速优化
  • 在线html网页制作工具seo单词优化
  • 房产网查询优化合作平台
  • 连云港公司做网站舟山seo
  • 网站建设asp网络推广发展
  • 晋江网站建设费用怎么在线上推广自己的产品
  • 做网站流量怎么解决网络推广运营是做什么
  • 网站开源源码竞价排名软件
  • 网页设计实训报告结论西安seo王
  • 网站开发的五个阶段推广优化厂商联系方式
  • 武汉有几家做蔬菜配送的网站重庆网站排名
  • 设计师常去的网站真正的免费建站在这里
  • 建设网站能挣钱吗深圳百度代理
  • 揭秘杭州亚运会开幕式亮点seo就业前景
  • 做试用网站的原理竞价培训课程
  • 沈阳网站建设与维护谷歌关键词优化怎么做
  • 网站构造下拉列表怎么做优化服务公司
  • 2018做网站还赚钱吗百度竞价开户渠道
  • 房地产建设企业网站搜索网页内容
  • java 网站开发书籍今日新闻头条新闻摘抄