css-shapes

how to create css concave/convex shapes

邮差的信 提交于 2019-12-05 06:00:54
I want to create two divs with the background white shape depicted below. As you can see it's basically a rectangle and a ellipse-shape being cut out. It should be able to produce a box-shadow. Is there a way to achieve this with css only? I have used 2 div's with box-shadow i have added border for understanding body { background:url(https://placeimg.com/640/480/any); } .out { width: 455px; height: 275px; border: 1px solid red; position: relative; overflow: hidden; margin: 20px; } .in { width: 550px; height: 550px; border: 1px solid green; position: absolute; left: 200px; border-radius: 50%;

Curved sail shape using HTML and CSS only?

梦想的初衷 提交于 2019-12-05 05:09:51
Is it possible to create the curved sail shape below using HTML and CSS only? I can see from this answer that I could create a straight-sided sail using: #triangle { width: 0; height: 0; border-right: 50px solid transparent; border-bottom: 100px solid red; } which looks like: or I can get a bit closer with border radius: #sail { background: #ff0000; width: 50px; height: 100px; border-top-right-radius: 50px 100px; -moz-border-radius-topright: 50px 100px; -webkit-border-top-right-radius: 50px 100px; -khtml-border-radius-topright: 50px 100px; } which looks like this: but isn't quite as elegant as

How do I add a border to an (8 point star) css shape?

纵然是瞬间 提交于 2019-12-05 02:10:20
问题 How do I add a red border outside this 8 point star? Or is there a simple svg solution anyone knows of? IS: NEED: JS fiddle HTML <div id="star8"></div> CSS #star8 { border: 3px solid red; background: blue; width: 80px; height: 80px; position: relative; -webkit-transform: rotate(20deg); -moz-transform: rotate(20deg); -ms-transform: rotate(20deg); -o-transform: rotate(20eg); } #star8:before { content: ""; position: absolute; top: 0; left: 0; height: 80px; width: 80px; background: blue; -webkit

CSS3 envelope shape

一笑奈何 提交于 2019-12-05 01:32:11
As you might have guessed this image is part of a mail envelope shape which I would like to create with CSS3 if possible. I've made the other parts but this one's tricky. The shape needs both a triangular cut on both sides and rounded corners (presumably border-radius-bottom-left/border-radius-bottom-right). It also has to have the ability to cast a small shadow. This is what I've done so far - #envelope { background: #fff; } .closed { width: 860px; height: 0; border-top: 80px solid fff; border-left: 50px solid transparent; border-right: 50px solid transparent; -moz-box-shadow: 0 1px 5px #ccc;

Diagonal Wedge Shaped CSS - Edge to Edge Centered in Browser

 ̄綄美尐妖づ 提交于 2019-12-05 00:16:24
I have been trying to make this shape in CSS. Ideally it will span the entire length of the browser window and probably extend outside the field of view to support larger screens and also be centered so that the angle does not change. Anyone have any solutions? Also I think I might run into a problem of the angle aliasing harshly. I might need to resort to using an image. Would like to use CSS though. ** Image Spelling Error. (Indefinitely not Inevitably) A solution that doesn't require CSS3 support: jsfiddle demo HTML <div class="shape"> <div class="top"></div> <div class="bottom"></div> <

How do I draw a horizontal line between two circles with CSS?

旧街凉风 提交于 2019-12-04 23:30:37
How do I draw a horizontal line in between 2 circles in CSS? It has to be in the middle of them just as shown in the screenshot. Example here: I have drawn the 2 circles, but don't know how to connect them. #status-buttons a { color: black; display: inline-block; font-size: 17px; font-weight: normal; margin-right: 0; text-align: center; text-transform: uppercase; min-width: 150px; text-decoration: none; } #status-buttons a:hover { text-decoration: none; } #status-buttons a.active span { color: white; background: #ACCF5B; box-shadow: rgba(0, 0, 0, 0.792157) 3px 3px 3px 0; } #status-buttons span

Button with pointed edges and shadow

梦想的初衷 提交于 2019-12-04 19:13:18
I'm trying to make a CSS button . As you can see below, I'm not able to create a gradient for the second HTML-element for the corners. Normally I would use borders or simply rotate a element to create a triangle with a gradient, but the problem is that my triangle isn't a 90 degree square. Desired design: (Grayscale, retina 200% zoomed) My CSS button: (Blue, retina 200% zoomed) Is there a better way to create this button with CSS? http://jsfiddle.net/G8ZBz/ or simply read below: HTML-code <div class="button"> <div class="button-inside"></div> </div> CSS .button { width: 225px; height: 60px;

Create doughnut shape in CSS [duplicate]

和自甴很熟 提交于 2019-12-04 16:09:28
问题 This question already has answers here : How do I create a circle or square with just CSS - with a hollow center? (7 answers) Closed 2 years ago . I know how to create a css circle with border radius etc, but i'm interested in creating a css only doughnut shape roughly like this one here -> It would be one div but curved round back onto itself, any ideas?? 回答1: <div class="doughnut"></div> .doughnut { border: 50px solid #f00; border-radius: 100px; height:100px; width:100px; } 回答2: Demo div

Interesting CSS shape navigation (chevrons)

一个人想着一个人 提交于 2019-12-04 14:43:42
问题 I'm building a fairly interestingly shaped navigation for a site at the moment. The shape each menu item needs to be is illustrated below: The final nav will look like an extended version of this: I thought it would be an interesting experiment to do these shapes in CSS. The CSS and HTML for one of the arrow shapes is here: .arrowEndOn { font-size: 10px; line-height: 0%; width: 0px; border-top: 11px solid #FFFFFF; border-bottom: 11px solid #FFFFFF; border-left: 5px solid transparent; border

How to style this triangle on a circular image?

老子叫甜甜 提交于 2019-12-04 14:33:33
问题 I am using bootstrap 3.3 in my project, I would like to style the photo using CSS. please guide me how can to do this? The preview (what I need): 回答1: You can do this using svg 's clipPath and filter s for the box-shadow . The co-ordinates for the triangle were calculated using the formula for a co-ordinate on a circle: (x, y) = (r × cos(θ), r × sin(θ)) where, r is the radius of a circle and θ is the angle. The co-ordinate that is not on the circle was assumed to be a co-ordinate on a circle