Is there a way to create a chrome-like tab using CSS?

后端 未结 8 736
北海茫月
北海茫月 2020-12-05 14:59

I have been looking for a Google Chrome-like tab written using CSS but cannot find one.

I am trying to replicate the look in order to use it in a web application or

8条回答
  •  感情败类
    2020-12-05 15:41

    What about this : http://codepen.io/justd/pen/dPeKEG/

    Find tuto here .

    @import "compass/css3";
    
    @import "compass";
    
    .tab-container {
      background: #8dc8fb;
      margin: 0;
      padding: 0;
      max-height: 40px;
    
      ul {
        &.nav-tabs {
          margin: 0;
          list-style-type: none;
          line-height: 40px;
          max-height: 40px;
          overflow: hidden;
          display: inline-block;
          @include display-flex;
          padding-right: 20px;
          border-bottom: 5px solid #f7f7f7;
    
          $color: #c3d5e6;
    
          > li {
            $raduis: 28px 145px;
    
            margin: 5px -14px 0;
            @include border-top-left-radius($raduis);
            @include border-top-right-radius($raduis);
            padding: 0 30px 0 25px;
            height: 170px;
            background: $color;
            position: relative;
            @include box-shadow(0 4px 6px rgba(0,0,0,.5));
            width: 200px;
            max-width: 200px;
            min-width: 20px;
            border:1px solid #aaa;
    
            &:first-child {
              margin-left: 0;
            }
    
            &:last-of-type {
              margin-right: 0;
            }
    
            > a {
              display: block;
              max-width:100%;
              text-decoration: none;
              color: #222;
              padding: 3px 7px;
    
              span {
                overflow: hidden;
                white-space: nowrap;
                display: block;
              }
    
              &:focus,
              &:hover {
                background-color: transparent;
                border-color: transparent;
              }
    
              .glyphicon-remove {
                color: #777;
                display: inline-block;
                padding:3px;
                font-size: 10px;
                position:absolute;
                z-index: 10;
                top:7px;
                right: -10px;
                @include border-radius(50%);
    
                &:hover {
                  background: #d39ea3;
                  color: white;
                  @include box-shadow(inset 0 1px 1px rgba(0,0,0,.25));
                  @include text-shadow(0 1px 1px rgba(0,0,0,.25));
                }
              }
            }
    
            &.active {
              z-index: 2;
              @include background-image(linear-gradient(white, #f7f7f7 30px));
    
              > a {
                background-color: transparent;
                border-color: transparent;
                border-bottom-color: transparent;
    
                &:focus,
                &:hover {
                  background-color: transparent;
                  border-color: transparent;
                  border-bottom-color: transparent;
                }
              }
            }
          }
    
          .btn {
            float: left;
            height: 20px;
            width: 35px;
            min-width: 35px;
            max-width: 35px;
            margin: 10px 0 0 0;
            border-color: #71a0c9;
            outline: none;
    
            @include transform(skew(30deg));
    
            &.btn-default {
              background: $color;
    
              &:hover {
                background: #d2deeb;
              }
    
              &:active {
                background: #9cb5cc;
              }
            }
          }
        }
      }
    
      .tab-pane {
        padding: 60px 40px;
        text-align: center;
    
        &.active {
          border-top:1px solid #ffffd;
        }
      }
    }
    

提交回复
热议问题