CSS自定义导航栏悬浮(三种实现方式)

html-css07

CSS自定义导航栏悬浮(三种实现方式),第1张

提供三种自定义导航栏悬浮的方法

在自定义组件中设定css 样式:

利用 position: fixed

利用 position: fixed

让每一个的第1个元素加上 clear:both属性,我这里每一行有2个,所以是: .b li:nth-child(2n-1){clear:both},如果每一行是3列,则加上:.b li:nth-child(3n-2){clear:both}。