Skew div border of one side only using one div only

后端 未结 1 1039
后悔当初
后悔当初 2020-12-16 07:58

I have created a skewed div using following css

#outer-left{
-ms-transform: skew(-30deg,0deg); /* IE 9 */
-webkit-transform:skew(-30deg,0deg); /* Chrome, Saf         


        
相关标签:
1条回答
  • 2020-12-16 08:56

    I believe this is what you want:

    http://jsfiddle.net/5a7rhh0L/3/

    CSS:

    #a {
        position: relative;
        width: 120px;
        padding: 10px 20px;
        font-size: 20px;
        position: relative;
    
        color: #2E8DEF;
        background: #333333;
        border-bottom: 3px solid #2E8DEF;
    }
    #a:after {
        content: " ";
        position: absolute;
        display: block;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: -1;
    
        background: #333333;
        border-bottom: 3px solid #2E8DEF;
        border-right: 20px solid #2E8DEF;
    
        transform-origin: bottom left;
        -ms-transform: skew(-30deg, 0deg);
        -webkit-transform: skew(-30deg, 0deg);
        transform: skew(-30deg, 0deg);
    }
    
    0 讨论(0)
提交回复
热议问题