1、first-childfirst-child表示選擇列表中的第一個標簽。代碼如下: li:first-child{background:#090}上面的意思是,li 列表中的 第一個li模塊的背景顏色。2、last-childlast-child表示選擇列表中的最后一個標簽,代碼 ...
說明:最近在寫前端vue 調樣式的時候遇到了一個問題 同一個div下對多個同級別的 lt span gt 標簽進行 邊距設置 總結:這個是對面同事跟我說的,很感謝他。咱前段基礎很菜 但是不怕菜,點滴積累即可 ...
2019-10-17 15:19 0 342 推薦指數:
1、first-childfirst-child表示選擇列表中的第一個標簽。代碼如下: li:first-child{background:#090}上面的意思是,li 列表中的 第一個li模塊的背景顏色。2、last-childlast-child表示選擇列表中的最后一個標簽,代碼 ...
1、first-child first-child表示選擇列表中的第一個標簽。代碼如下: li:first-child{background:#090} 上面的意思是,li 列表中的 第一個li模塊的背景顏色。 2、last-child last-child表示選擇列表中的最后一個標簽 ...
first-child E:first-child是偽類選擇器, 匹配父元素的第一個子元素E 從說明可以看出E是你要選擇的第一個子元素,而不是父元素。一開始,誤以為E:first-child是E的第一個子元素。 :nth-child(n) 匹配父元素的第n個子元素E E也是子元素 ...
一個記住的好方法: odd是3個字母,單數,所以表示奇數 even是4個字母,所以表示偶數 ...
nth-child(n) <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport ...
一、選擇列表中的偶數標簽 :nth-child(2n) 二、選擇列表中的奇數標簽 :nth-child(2n-1) 三、選擇從第6個開始的,直到最后:nth-child(n+6) 四、選擇第1個到第6個 :nth-child(-n+6) 一、兩者結合使用,可以限制選擇 ...
一、零碎 1、first-child、last-child、nth-child(n)、nth-child(2n)、nth-child(2n-1)、nth-child(odd)、nth-child(even)、nth-last-child(3)(倒數第 ...