CSS how to make special div shape


Tags: css,css3,css-shapes

Problem :

Any idea how to make the div shape like this ?

enter image description here



Solution :

Just create a rectangle and skew the Y axis using the CSS3 transform property.

In this case, transform: skewY(-20deg) will work.

.shape {
    border: 2px solid;
    height: 200px;
    width: 100px;
    transform: skewY(-20deg);
    margin: 2em 0;
}
<div class="shape"></div>


    CSS Howto..

    How To Get Circle Image Between
    Tag Like Tumblr In HTML? [closed]

    How to cancel left or right rules with an !important tag?

    How to change the display property in a css class using js when user clicks a button

    Bootstrap: how to clear images in a gallery?

    In IE6, how to implement a:hover?

    How to align horizontally list if there is a sublist css

    How to create offer tag with css and pass value to it

    How to use PHP to get the value of a star rating widget?

    less: how to import multiple css?

    How to use font-awesome from server

    How to highlight an image after selection using css or jquery? [closed]

    How do I make a play button for my full page video?

    How to customize bootstrap css when using bootstrap-sass [closed]

    How to get CSS class property in Javascript?

    How do I center text vertically with css [duplicate]

    How To Use CSS To Style The Output Of JavaScript

    Bootstrap - how to clear css from element to start over?

    How to align floated elements to the bottom of their container

    How to optimize my css/html webpage? [closed]

    How to add multiple CSS classes to HTML node in Closure template (soy)?

    How to GPU accelerate CSS transform?

    How to set ID or css selector for new row added in table using javascript

    How do you implement CSS without to have clear:both on float left and float right

    How to set the width of a list, in css

    Show another element with hover

    How to create a image transition hover effect with css without breaking the grid layout

    How to center CSS Navigation Menu

    How do I center align the items in my menu?

    When I say position:fixed, how do I tell mobile browsers I mean it?

    How to change color and background of whole web site