前端3+1(Day5)

前端3+1(Day5)

超链接的target属性有哪些,分别有哪些作用

  1. _blank 浏览器总是打开一个新标签
<a href="#" target="_blank"></a>
  1. _self (默认),就在这个页面内打开,(在这个框架下显示)

  2. _parent,在父框架下打开链接(在上一级的窗口中显示)

  3. _top,在浏览器 整个窗口运行,忽略掉所有框架

css3新增伪类

  1. :first-child 他匹配的就是结构上的第一个,如果不符合,那么就是匹配不到
<div>
    <p>第一子元素</p>
    <h1>第二子元素</h1>
    <h1>第三子元素</h1>
    <span>第四子元素</span>
</div>

p:first-child,那么就是可以匹配到的

h1:first-child,就是匹配不到,因为h1不是第一个子元素

h1-first-of-type,可以匹配到两个h1的第一个

  1. :nth-child(n)

  2. :last-child

  3. :nth-last-child(n)

  4. :first-of-type 一组兄弟元素的其中第一个

  5. :last-of-type

  6. :nth-of-type(n)

  7. :nth-last-of-type(n)

  8. :only-child

  9. :empty 连空格都没有的元素

posted @ 2022-01-09 12:59  summer在writing  阅读(15)  评论(0编辑  收藏  举报