1、設置用戶是否能夠選中文本屬性:
? ? ? ? 問題:移動端長按不能復制文本
? ? ? ? 解決:user-select:none |?text?| all | element
2、獲取元素子元素:
? ? ? ? 1.? childNodes? |? firstChild? |? lastChild? 存在兼容問題,可能選擇到換行或者空格
? ? ? ? 2.? children |? firstElementChild? |? lastElementChild??
3、獲取元素兄弟節(jié)點:
? ? ? ? 1.previousSibling? |? nextSibling??存在兼容問題,可能選擇到換行或者空格
? ? ? ? 2.previousElementSibling |? nextElementSibling? 直接匹配節(jié)點
4、獲取父元素:
? ? ? ? parentNode
5、Flex布局
? ? ? ? 容器(父):
? ? ? ? ? ? ? ? flex-direction:? row? |? row-reverse? |? column |? column-reverse? ? ?決定主軸的方向
? ? ? ? ? ? ? ? flex-wrap:? nowrap? |? wrap? |? wrap-reverse? ?如果一條軸線排不下,如何換行
? ? ? ? ? ? ? ? flex-flow :? row nowrap? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? flex-direction屬性和flex-wrap屬性的簡寫形式
? ? ? ? ? ? ? ? justify-content:? flex-start? |? flex-end? |? center? |? space-between? |? space-around? ? ?項目在主軸上的對齊方式
? ? ? ? ? ? ? ? align-items: flex-start? |? flex-end? |? stretch? |? baseline? |? center? ?項目在交叉軸上如何對齊
? ? ? ? ? ? ? ? align-content:? flex-start | flex-end | center | space-between | space-around | stretch? ?多根軸線的對齊方式。如果項目只有一根軸線,? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?該屬性不起作用
? ? ? ? 項目(子):
? ? ? ? ? ? ? ??order? 屬性定義項目的排列順序。數值越小,排列越靠前,默認為0
? ? ? ? ? ? ? ? flex-grow? 定義項目的放大比例,默認為0,即如果存在剩余空間,也不放大
? ? ? ? ? ? ? ? flex-shrink? ?定義了項目的縮小比例,默認為1,即如果空間不足,該項目將縮小
? ? ? ? ? ? ? ? flex-basis? ?定義了在分配多余空間之前,項目占據的主軸空間(main size)。瀏覽器根據這個屬性,計算主軸是否有多余空間。它的? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 默認值為auto,即項目的本來大小
? ? ? ? ? ? ? ? flex? ? ? ? ? ? ?flex-grow, flex-shrink 和 flex-basis的簡寫,默認值為0 1 auto。后兩個屬性可選
? ? ? ? ? ? ? ? align-self:? flex-start? |? flex-end? |? auto? |? stretch? |? center? |? baseline? ? ? ?默認值為auto