前端3+1(Day5)
阿新 • • 發佈:2022-01-10
前端3+1(Day5)
超連結的target屬性有哪些,分別有哪些作用
- _blank 瀏覽器總是開啟一個新標籤
<a href="#" target="_blank"></a>
-
_self (預設),就在這個頁面內開啟,(在這個框架下顯示)
-
_parent,在父框架下開啟連結(在上一級的視窗中顯示)
-
_top,在瀏覽器 整個視窗執行,忽略掉所有框架
css3新增偽類
- :first-child 他匹配的就是結構上的第一個,如果不符合,那麼就是匹配不到
<div> <p>第一子元素</p> <h1>第二子元素</h1> <h1>第三子元素</h1> <span>第四子元素</span> </div>
p:first-child,那麼就是可以匹配到的
h1:first-child,就是匹配不到,因為h1不是第一個子元素
h1-first-of-type,可以匹配到兩個h1的第一個
-
:nth-child(n)
-
:last-child
-
:nth-last-child(n)
-
:first-of-type 一組兄弟元素的其中第一個
-
:last-of-type
-
:nth-of-type(n)
-
:nth-last-of-type(n)
-
:only-child
-
:empty 連空格都沒有的元素