css实现滑动式导航条菜单效果代码
代码语言:html
所属分类:菜单导航
代码描述:css实现滑动式导航条菜单效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url(https://fonts.googleapis.com/css?family=Open+Sans:600);.Nav-item:nth-child(1).is-active ~ .Nav-item:last-child:after { left: 0 } .Nav-item:nth-child(1):hover ~ .Nav-item:last-child:after { left: 0!important } .Nav-item:nth-child(1).is-active ~ .Nav-item:last-child:before { left: 10% } .Nav-item:nth-child(1):hover ~ .Nav-item:last-child:before { left: 10%!important } .Nav-item:nth-child(2).is-active ~ .Nav-item:last-child:after { left: 20% } .Nav-item:nth-child(2):hover ~ .Nav-item:last-child:after { left: 20%!important } .Nav-item:nth-child(2).is-active ~ .Nav-item:last-child:before { left: 30% } .Nav-item:nth-child(2):hover ~ .Nav-item:last-child:before { left: 30%!important } .Nav-item:nth-child(3).is-active ~ .Nav-item:last-child:after { left: 40% } .Nav-item:nth-child(3):hover ~ .Nav-item:last-child:after { left: 40%!important } .Nav-item:nth-child(3).is-active ~ .Nav-item:last-child:before { left: 50% } .Nav-item:nth-child(3):hover ~ .Nav-item:last-child:before { left: 50%!important } .Nav-item:nth-child(4).is-active ~ .Nav-item:last-child:after { left: 60% } .Nav-item:nth-child(4):hover ~ .Nav-item:last-child:after { left: 60%!important } .Nav-item:nth-child(4).is-active ~ .Nav-item:last-child:before { left: 70% } .Nav-item:nth-child(4):hover ~ .Nav-item:last-child:before { left: 70%!important } .Nav-item:nth-child(5).is-active ~ .Nav-item:last-child:after { left: 80% } .Nav-item:nth-child(5):hover ~ .Nav-item:last-child:after { left: 80%!important } .Nav-item:nth-child(5).is-active ~ .Nav-item:last-child:before { left: 90% } .Nav-item:nth-child(5):hover ~ .Nav-item:last-child:before { left: 90%!important } .NavMain-list { margin: 50px auto; width: 900px; padding: 0; list-style: none; position: relative; z-index: 0 } .Nav-item { display: block; float: left; margin: 0; padding: 0; width: 20%; text-align: center; overflow: hidden; background: #fff } .Nav-item:first-child { border-radius: 3px 0 0 3px } .Nav-item a { -webkit-text-fill-color: transparent; -webkit-background-clip: text; box-sizing: content-box; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuMCIgeTE9IjAuNSIgeDI9IjEuMCIgeTI9IjAuNSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmMDAwMCIvPjxzdG9wIG9mZnNldD0iMjAlIiBzdG9wLWNvbG9yPSIjZmYwMDAwIi8+PHN0b3Agb2Zmc2V0PSIyMSUiIHN0b3AtY29sb3I9IiM1ZTVmNTUiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM1ZTVmNTUi.........完整代码请登录后点击上方下载按钮下载查看
网友评论0