css+js实现中性tab选项卡效果代码
代码语言:html
所属分类:选项卡
代码描述:css+js实现中性tab选项卡效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> */ @import url(https://fonts.googleapis.com/css?family=Nunito+Sans); /* RESET */ * { box-sizing: border-box; margin: 0; padding: 0; } /* STYLING */ .container { display: flex; height: 100vh; background-color: #f4f4f4; color: #a2a2a2; font-family: "Nunito Sans", Arial, Helvetica, sans-serif; } .darkmode .container { background-color: #1A1B1F; color: #8a8a8a; } .tabs-container { width: 540px; max-width: 620px; min-width: 420px; margin: auto; } /* Style the tabs */ .tabs { margin-bottom: 28px; display: flex; justify-content: space-between; } .tabs a { cursor: pointer; padding: 12px 24px; width: 120px; text-align: center; font-weight: bold; border-radius: 18px; transition: background 0.1s, color 0.1s; background: linear-gradient(145deg, #ffffff, #dcdcdc); box-shadow: 3px 3px 5px #bebebe, -3px -3px 5px #ffffff; } .darkmode .tabs a { background: linear-gradient(145deg, #1c1d21, #17181c); box-shadow: 3px 3px 6px #101114, -3px -3px 6px #24252a; } /* Change background color of tabs on hover */ .tabs a:hover { background: linear-gradient(145deg, #f4f4f4, #cecece); color: #888; } .darkmode .tabs a:hover { background: #141414; color: #bbb; } /* Styling for active tab */ .tabs a.active { background-color: #f4f4f4; color: #bdbdbd; cursor: default; padding: 14px 22px 10px 26px; background: #f4f4f4; box-shadow: inset 3px 3px 5px #cbcbcb, inset -3px -3px 5px #ffffff.........完整代码请登录后点击上方下载按钮下载查看
网友评论0