0

How to slant the side of of tab tile i want to make it like a sublime tab

enter image description here

.tab li.tile {
  min-width: -webkit-min-content;
  min-width: -moz-min-content;
  min-width: min-content;
  height: 30px;
  overflow: hidden;
  border-bottom: none;
  border-top: solid 0.5px #636363;
  border-right: solid 0.5px #636363;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  font-size: 0.8em;
  align-items: center;
  margin: 0;
  padding: 0;
  color: inherit
}

Newbieee
  • 167
  • 10

1 Answers1

0

You can do something like this:

$('.tile').prepend('<div class="tr"></div>')
               .prepend('<div class="tl"></div>')
.tile {
    position: relative;
    margin: 10px;
    width: 200px;
    height: 15px;
    padding: 20px;
    background-color: #ccc;
    text-align: center;
}

.tile .tl, .tile .tr,
.tile .bl, .tile .br {
    width: 0; 
    height: 0;
    position: absolute;        
}

.tile .tl {
    top: 0;
    left: 0;
    border-top: 60px solid white; 
    border-right: 20px solid transparent;
}
.tile .tr {
    top: 0;
    right: 0;
    border-top: 60px solid white; 
    border-left: 20px solid transparent;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="tile">
    Hello world!
</div>
John
  • 5,132
  • 1
  • 6
  • 17