How to create a corner like this in CSS

3 answers

JQuery Corner Plugin

Corner is a simple plugin for creating rounded (or other style) corners on elements.

+3
source

Yes, with CSS, only round / elliptical borders are available. If you need other shapes, you will need to use an image.

You can get straight diagonals by abusing boundary connections:

<div style="background: gray; height: 100px; width: 200px; position: relative;">
    <div style="height: 1px; width: 1px; border-top: solid gray 20px; border-right: solid white 20px; position: absolute; bottom: -1px; right: 0;"></div>
</div>

Not sure if a particularly good idea.

+2
source

bobince, , ? , :

element {
  background: gray url(cornerImage) no-repeat bottom right;
}

This is better than the jQuery plugin, since no scripts are needed (which should be avoided for presentation as much as possible). The corner image will be just a small square image with gray and white triangles.

+1
source

Source: https://habr.com/ru/post/1743777/


All Articles