css-shapes

How does this CSS produce a circle?

 ̄綄美尐妖づ 提交于 2019-11-26 23:15:38
This is the CSS: div { width: 0; height: 0; border: 180px solid red; border-radius: 180px; } How does it produce the circle below? Suppose, if a rectangle width is 180 pixels and height is 180 pixels then it would appear like this: After applying border-radius 30 pixels it would appear like this: The rectangle is becoming smaller, that is, almost going to disappear if the radius size increases. So, how does a border of 180 pixels with height/width-> 0px become a circle with a radius of 180 pixels? How does a border of 180 pixels with height/width-> 0px become a circle with a radius of 180

CSS3 Inverted Rounded Corner

大憨熊 提交于 2019-11-26 23:09:13
问题 Is there a way to do an inverted rounded corner in CSS3, something approximately like the bottom left corner in the (crude) drawing below? /-------\ | | | | | | | ______/ |/ <---The left side is flush (straight), the slant should be rounded Perhaps border-radius could be combined with this technique? Edit: I'm not looking for a speech bubble, but rather just a way to curve the right side of the point on the bottom left. 回答1: Well, this is pure madness, but certainly there are ways to achieve

Hover and click on CSS triangle

寵の児 提交于 2019-11-26 23:05:07
问题 I have a triangle with a javascript function that moves that image. The issue is that the element has a square shape so click and hover state are triggered ouside the triangle (see the red part in following image) : How can I prevent hover and click outside the triangle shape and allow click/hover state only inside the triangle shape? 回答1: To prevent hover and click outside the CSS triangle you can use transforms to make the the triangle. This technique is described here : CSS Triangles with

Hexagon shape with a border/outline

天大地大妈咪最大 提交于 2019-11-26 22:58:39
I know it's possible to create a hexagon shape using the following code: .hex:before { content: " "; width: 0; height: 0; border-bottom: 30px solid #6C6; border-left: 52px solid transparent; border-right: 52px solid transparent; position: absolute; top: -30px; } .hex { margin-top: 30px; width: 104px; height: 60px; background-color: #6C6; position: relative; } .hex:after { content: ""; width: 0; position: absolute; bottom: -30px; border-top: 30px solid #6C6; border-left: 52px solid transparent; border-right: 52px solid transparent; } How can I create a hexagon that's filled with one color, and

How can I create a round arrow with only HTML and CSS?

ぃ、小莉子 提交于 2019-11-26 22:51:59
问题 I'm trying to create a round directional arrow with CSS and HTML. Below are my attempts. Attempt 1 In this I have rotated the <div> and an arrow, but both are in different positions. This is the CSS: #curves div { width: 100px; height: 100px; border: 5px solid #999; } #curves.width div { border-color: transparent transparent transparent #999; } #curve1 { -moz-border-radius: 50px 0 0 50px; border-radius: 50px 0 0 50px; } .arrow-right { width: 0; height: 0; border-top: 10px solid transparent;

Responsive CSS Trapezoid Shape

丶灬走出姿态 提交于 2019-11-26 22:35:17
I'm looking to create a responsive trapezoid shape which can be in either CSS, SVG or Canvas. I have been able to create the triangle shape but not a trapezoid shape that is responsive. div { width: 0; height: 0; border-top: 5vw solid transparent; border-left: 10vw solid red; border-bottom: 5vw solid transparent; } <div></div> I have seen there are many questions on SO already that encompass a trapezoid shape but very little have reasons why they are better than other methods and also a large majority aren't responsive. As an example, these questions don't require responsiveness and therefore

Adjacent divs with angled borders? [duplicate]

北城以北 提交于 2019-11-26 22:34:09
This question already has an answer here: Shape with a slanted side (responsive) 3 answers I want to create two divs which are floated left to each other, however with a slanted angled border separating them. I've attached a picture to demonstrate what I mean. Does anyone know if something like this is possible with CSS (cutting off the content with an overflow:hidden I guess) These divs need to contain images that get cut off by the border, here is an example : Try this .left, .right { position: relative; height: 100px; width: 200px; background: #000; float: left; } .left:after { content: '';

Segments in a circle using CSS3

試著忘記壹切 提交于 2019-11-26 22:08:35
I know you can make a circle in CSS3 using the border radius hack. But is there any way to make them have segments like this picture? Is there a way of doing this through HTML and CSS but not JS? Ana Yes, you can get such slices of custom angles using either one of the following two methods: If you don't need the slices to be elements themselves, the you can simply do it with one element and linear gradients - see this rainbow wheel I did last month. If you need the slices to be elements themselves, then you can do it by chaining rotate and skew transforms - see this circular menu I did a

How to create an irregular square shape in css?

≡放荡痞女 提交于 2019-11-26 22:02:22
问题 Looking for the code to make this particular shape with CSS.. Any help much appreciated! 回答1: You can use clip-path. The clip-path CSS property creates a clipping region that defines what part of an element should be displayed. More specifically, those portions that are inside the region are shown, while those outside are hidden. Try this code snippet. div{ width: 150px; height: 150px; -webkit-clip-path: polygon(5% 7%, 91% 14%, 98% 91%, 0% 100%); clip-path: polygon(5% 7%, 91% 14%, 98% 91%, 0%

Triangle in CSS inside a box [closed]

假如想象 提交于 2019-11-26 21:50:40
问题 Well I don't know how to explain it correctly. Here, check this screenshot which has what I want to make. My designer gave me this. If I don't find a solution i'll use images and no code. Is it possible to do this with CSS3? Here is the image See the triangle inside that box? I want to do this. Thank you! 回答1: Creative use of borders to achieve this effect, no images were harmed in the following sample and you can even set the position of the arrow on the element itself - becomes more