css-shapes

Hexagon shape with CSS3

牧云@^-^@ 提交于 2019-11-26 17:52:18
问题 Can such a hexagon be created with pure CSS3? Thanks for any help! 回答1: A simple search turned this up: CSS Hexagon Tutorial Referenced from the site: Put a 104px × 60px div with a background colour between them and you get (the hexagon): width: 0; border-bottom: 30px solid #6C6; border-left: 52px solid transparent; border-right: 52px solid transparent; width: 104px; height: 60px; background-color: #6C6; width: 0; border-top: 30px solid #6C6; border-left: 52px solid transparent; border-right:

Is a concave border radius possible?

纵饮孤独 提交于 2019-11-26 17:50:58
Here is a simple convex example. http://jsfiddle.net/swY5k/ #test{ width: 200px; height: 200px; background: #888888; border-radius: 50px; } However, I want a concave border radius. I tried making the border-radius negative but this did not work. Example of concave/convex: You can give the impression of a concave border using radial gradients on the background. For example, something like this: #test { width: 200px; height: 200px; background: #888888; background: radial-gradient(circle 20px at -20% 50%,transparent,transparent 100px,#888888 100px), radial-gradient(circle 20px at 120% 50%

Double curved shape

旧时模样 提交于 2019-11-26 17:47:56
问题 I am currently attempting to generate a 'wavy ghostly bottom' shape. This shape contains two double curves: Although the bottom part of this image I think portrays it in better imagery. My Code My Current Attempt to generate this shape was using pseudo elements and overflow: hidden , although this does not allow for a gradient background (would require a plain background): Attempt 1 - Using Pseudo Elements with overflow hidden .bottom { height: 300px; width: 300px; background: lightgray;

Create a triangle with CSS?

穿精又带淫゛_ 提交于 2019-11-26 17:46:04
问题 How can I create the following shape with CSS? I tried this to be a solution: .triangle:after { position:absolute; content:""; width: 0; height: 0; margin-top:1px; margin-left:2px; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 10px solid white; } .triangle:before { position:absolute; content:""; width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 12px solid black; } You can see it working at

How to achieve chamfered CSS Border Corners rather than rounded corners?

喜欢而已 提交于 2019-11-26 17:41:10
问题 With the CSS border-radius property I can have a curvy, rounded border corner at the end. .boxLeft{ border-right: 1px dashed #333; border-bottom: 1px dashed #333; border-radius: 0 0 10px 0; } .boxRight{ border-left: 1px dashed #333; border-bottom: 1px dashed #333; border-radius: 0 0 0 10px; } But I want a border corner like the image below. If I have two boxes (Yellow & Pink) meeting each other and I want a harsh corner at the bottom meeting point (dotted corner), what should I do? Is that

Square DIV where height is equal to viewport

我是研究僧i 提交于 2019-11-26 17:38:41
问题 I need to create a DIV where width=height , and height=100% of the viewport (which, obviously, is variable). In other words, a perfectly square DIV that calculates it's dimensions based on the height of the viewport . Elements within that DIV will take their dimensions as percentages of the parent-DIV's height & width. It seems to me like this should be simple to do in CSS , but I've gotten stuck with it! Any pointers would be much appreciated. 回答1: You can do this with jquery (or pure

Circular percent progress bar

耗尽温柔 提交于 2019-11-26 17:31:47
I would like to have an percent circle indicator on my site: In this case it's showing 75%. How should this be done? I have the yellow circle in a image-file, but if it's easier to, some how, do it all using CSS, that's okay with me. Considering the shape of the progress bar (rounded end/start) I would suggest using SVG. DEMO: Radial progress bar In the following example, the progress is animated with the stroke-dasarray attribute and the % numbers are incremented with jQuery: var count = $(('#count')); $({ Counter: 0 }).animate({ Counter: count.text() }, { duration: 5000, easing: 'linear',

Make CSS3 triangle with linear gradient

流过昼夜 提交于 2019-11-26 17:09:02
问题 I need to create button with triangle on one side (like this http://css-tricks.com/triangle-breadcrumbs/ ) with linear vertical gradient and border, and I want to use pure CSS3. It's ok if I need 45deg "triangle", I just write smth like this .button:after { -webkit-transform: rotate(45deg); background: -webkit-linear-gradient(-45deg, #fff, #000); content: ''; width: 2em; height: 2em; display: block; } and hide half of that pseudo-element under .button (so only another half of it is visible,

How can I create a “tooltip tail” using pure CSS?

好久不见. 提交于 2019-11-26 17:06:18
I just came across a neat CSS trick. Check out the fiddle... .tooltiptail { display: block; border-color: #ffffff #a0c7ff #ffffff #ffffff; border-style: solid; border-width: 20px; width: 0px; height: 0px; } .anothertail { background-image: url(http://static.jqueryfordesigners.com/demo/images/coda/bubble-tail2.png); display: block; height: 29px; width: 30px; } <div>Cool Trick: <br /> <div class="tooltiptail"></div> </div> <br /> <div>How do I get this effect with only CSS? <br /> <div class="anothertail"></div> </div> This creates a little arrow/triangle-like effect, a "tooltip tail". This

css: how to draw circle with text in middle?

做~自己de王妃 提交于 2019-11-26 17:05:46
I found this example on stackoverflow: Draw Circle using css alone Which is great. But I'd like to know how to modify that example so that I can include text in the middle of the circle? I also found this: Vertically and horizontally centering text in circle in CSS (like iphone notification badge) but for some reason, its not working for me. When I create the following test code: <div class="badge">1</div> instead of a circle, I get a oval shape. I'm trying to play around with the code to see how I can get it to work. Jawad JSFiddle .circle { width: 500px; height: 500px; border-radius: 50%;