css-shapes

Filling water animation

久未见 提交于 2019-11-27 06:26:56
I am trying to get a wipe up animation to make a circle look like it's filling with water . I've run into two errors, and haven't been able to even tackle the 3rd one: It fills up the wrong way It resets to empty (black) after it has filled * For now, I am using the <img> tags, but I would like to move this effect to body { background-image: } and need some direction on how to do this. What I have tried so far: #banner { width: 300px; height: 300px; position: relative; } #banner div { position: absolute; } #banner div:nth-child(2) { -webkit-animation: wipe 6s; -webkit-animation-delay: 0s;

How can I create a concave bottom border in CSS?

心不动则不痛 提交于 2019-11-27 06:18:11
问题 Content needs to be able to scroll behind it in the concave area and not be obscured. Specifically, I'm trying to create this: 回答1: For a transparent background, you can use box-shadows : DEMO Explanation : The point of this technique is to use a pseudo element with box-shadows and a transparent backcground to see through it. The pseudo element is abolutely positioned and has a much larger width than the container in order to (with the help of border radius) give a smooth inset curve to the

Creating an Isoceles Trapezoid shape

僤鯓⒐⒋嵵緔 提交于 2019-11-27 05:39:26
I'm wondering if I could produce something similar to this with CSS: And I'm also wondering, is this the right place for such a question? I have not tried anything codewise, I've done the brown images with photoshop. Thanks for any help ! This shape (an Isoceles Trapezoid ) can be easily made using CSS3 by rotating a div with a bit of perspective . Explanation The shape is achieved by rotating an absolutely positioned pseudo-element ( .container:after ) along the x-axis with a perspective. We are not rotating the actual container div because it would cause the link (and any other) text inside

Half hexagon shape with one element

守給你的承諾、 提交于 2019-11-27 05:30:35
I'm trying to replicate the following shape with no success: I'm guessing I'll need some :before and :after pseudo elements along with the following css: #pentagon { position: relative; width: 78px; height:50px; background:#3a93d0; } Harry Using Border Method: You can do it using the below CSS. The shape is obtained by placing a triangle shape at the bottom of the rectangle using :after pseudo element. The triangular part is achieved using border method. .pentagon { height: 50px; width: 78px; background: #3a93d0; position: relative; } .pentagon:after { border: 39px solid #3a93d0; border-top

Div with cut out edges, border and transparent background

可紊 提交于 2019-11-27 05:27:19
I've been trying to figure out how to make a custom shape in CSS that visually will look like this: With the property of background:rgba(44, 44, 48, 0.9) and border:6px solid rgba(29, 30, 35, 0.9); My problem is that I cannot find a way to make the top-right and bottom-left border look like the image I provided. Tried the tips on CSS Custom Shape on CSS-Tricks but it doesn't seem to solve the problem as it cannot have background. Any ideas? o.v. Unfortunately you cannot have a pseudo-element added to a pseudo-element (i.e. :after:after{} will not work) - with a complex shape like yours, you

How to create a triangle in CSS3 using border-radius

假装没事ソ 提交于 2019-11-27 05:09:13
I am using border-radius property to acheive rounded corners. But I am not sure how to get rounded corners of this shape. I tried giving same dimensions from either sides but they just dont give me the exact shape. Am I missing some CSS3 property here. Just wondering if clip css property is the answer. UPDATE: http://jsfiddle.net/YWnzc/136/ Demo #player { margin: 32px; position: relative; width: 400px; height: 250px; background-color: #222; } #inner { transform: rotate(45deg); background-color: silver; width: 100px; height: 100px; top: 20px; left: -50px; position: relative; border-radius: 20px

Circle loading animation

霸气de小男生 提交于 2019-11-27 05:07:05
问题 I'm trying to create Apple's OS X circle loading animation. What I have tried so far: .animation-wrapper { width: 200px; height: 200px; border: 1px solid black; border-radius: 50%; position: relative; overflow: hidden; filter: brightness(0.8); -webkit-filter: brightness(0.8); } .pie-piece1 { position: absolute; width: 50%; height: 50%; bottom: 0; left: 0; background: linear-gradient(to right, rgba(255, 0, 0, 1) 0%, rgba(255, 255, 0, 1) 100%); } .pie-piece2 { position: absolute; width: 50%;

Vertically and horizontally centering text in circle in CSS (like iphone notification badge)

*爱你&永不变心* 提交于 2019-11-27 04:59:42
问题 I'm looking for a way of to do a cross-browser iphone-like badge in CSS3. I'd obviously like to use one div for this, but alternative solutions would be fine. The important factor is that it needs to be horizontally and vertically centered in all browsers. An interesting design issue about these notifications is that they cannot have a specified width (height is fixed) - they should be able to handle [in ascii drawing] (1) and (1000), where (1000) is not a perfectly rounded circle, but

How do I create a teardrop in HTML?

喜夏-厌秋 提交于 2019-11-27 04:56:23
问题 How do I create a shape like this to display on a webpage? I don't want to use images since they would get blurry on scaling I tried with CSS : .tear { display: inline-block; transform: rotate(-30deg); border: 5px solid green; width: 50px; height: 100px; border-top-left-radius: 50%; border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; } <div class="tear"> </div> That turned out really screwed. And then I tried with SVG: <svg viewBox="0 100 100"> <polygon points="50,0 100,70 50,100

How can I animate the drawing of text on a web page?

此生再无相见时 提交于 2019-11-27 04:54:52
问题 I want to have a web page which has one centered word. I want this word to be drawn with an animation, such that the page "writes" the word out the same way that we would, i.e. it starts at one point and draws lines and curves over time such that the end result is a glyph. I do not care if this is done with <canvas> or the DOM, and I don't care whether it's done with JavaScript or CSS. The absence of jQuery would be nice, but not required. How can I do this? I've searched exhaustively with no