Tabbed navigation

后端 未结 4 876
余生分开走
余生分开走 2021-01-28 14:26

I\'m having real difficulty figuring how to do the following:

I want to have two tabs (horizontal next to each other), one for search (and labelled as such) and another

4条回答
  •  梦毁少年i
    2021-01-28 14:57

    This is the best you could do with pure css.

    /// Markup
    
    
    
    
    /// CSS
    
    html,
    body {
      height: 100%;
      width: 100%;
      margin: 0;
      overflow: hidden;
    }
    ul.tabs li {
      float: left;
      margin: 20px 0 5px 10px;
      list-style: none;
      width: 100px;
    }
    ul.tabs li a {
      display: block;
      background-color: #ccc;
      padding: 5px 10px;
      cursor: pointer;
      text-align: center;
    }
    ul.tabs li a:hover {
      background-color: #7cc6fb;
    }
    ul.tabs li:focus {
      outline: none;
    }
    ul.tabs li:focus > a {
      background-color: #0094ff;
    }
    ul.tabs li:focus .tab-content {
      z-index: 100;
    }
    ul.tabs li .tab-content {
      position: absolute;
      left: 20px;
      top: 70px;
      right: 20px;
      bottom: 20px;
      z-index: 10;
      padding: 50px;
      background-color: #fff;
      border: 1px solid #999;
    }
    

提交回复
热议问题