1. 程式人生 > 其它 >前端3+1(Day5)

前端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 連空格都沒有的元素