Does anyone have an idea how to make this tab like shape :
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
Here is an alternate approach using CSS3 transforms for achieving the required shape. Like the SVG answer, this method can also be used when the background (behind the shape) is not a solid color.
The snippet has two samples and
transform: skew(45deg)
andoverflow: hidden
on the parent to hide the skewed area on the left side.rotateX
transform with a bit ofperspective
to produce the skewed/angled side. Thetransform-origin
setting means that only one side is angled.The CSS solutions create the tab shape by placing a white shape on top of the brown. If you have something behind the shape, that might not be desirable.
Here is an SVG reproduction of your image.
Here is figure:
Setting the border of an after element so that it cancels out the top part of the shape :)
Take a single
<div>
, and apply: