css-shapes

How to draw a trapezium/trapezoid with css3?

有些话、适合烂在心里 提交于 2019-11-27 04:29:26
When you go to the page http://m.google.com using Mobile Safari, you will see the beautiful bar on the top of the page. I wanna draw some trapeziums (US: trapezoids) like that, but I don't know how. Should I use css3 3d transform? If you have a good method to achieve it please tell me. ElHacker You can use some CSS like this: #trapezoid { border-bottom: 100px solid red; border-left: 50px solid transparent; border-right: 50px solid transparent; height: 0; width: 100px; } <div id="trapezoid"></div> It is really cool to make all this shapes, Take a look to more nice shapes at: http://css-tricks

How to create a curve as shown below for the div

痴心易碎 提交于 2019-11-27 04:01:43
问题 I have a problem when creating a div above the circle as shown below! I have set up like this CSS: .count-select { box-shadow: 0 -5px 10px -5px rgba(0,0,0,.8); border-top: 2px solid #E75532; height: auto; width: 100%; background: #fff; position: fixed; bottom: 0; padding: 12px; border-radius: 50%/100px 100px 0 0; } As a result, it is not like the design, expect people to help. Thank you! 回答1: You can make the element to overflow by adding negative values to left/right. then add some padding

Responsive CSS Circles

荒凉一梦 提交于 2019-11-27 03:58:36
Goal: Responsive CSS circles that: Scale with equal radius. Radius can be calculated by percent. Radius can be controlled by media queries. If solution is javascript , I still need to emulate media query triggers. I dont 'need' media queries but I do want the ability to control the radius by percentage at certain widths: @media (max-width : 320px) { .x2{padding: 50%;} } @media (min-width : 321px) and (max-width : 800px) { .x2{padding: 25%;} } @media (min-width: 801px) { .x2{padding: 12.5%;} } Here is what I have so far: http://jsfiddle.net/QmPhb/ <div class="x1"> <div class="x2"> lol dude <

Oblique or twisted border shape

假如想象 提交于 2019-11-27 03:50:08
问题 I'm interested if it's possible to create wrapped (or maybe better said twisted) border using CSS. Effect I wanted to achieve is in the picture. 回答1: Most easiest and neat solution would be to use svg to create the border. #container { position: relative; width: 200px; height: 30px; } #content { text-transform: uppercase; position: absolute; width: 200px; height: 30px; top: 0; text-align: center; line-height: 30px; } <div id="container"> <svg width="200" height="30" viewBox="-1 -2 201 33">

How do you get a triangle hover effect on a pure css navbar?

时光毁灭记忆、已成空白 提交于 2019-11-27 03:38:32
问题 I would like to have a little triangle underneath the the text that points up when the user hovers over the different tabs. Here is a bit of code I'm working with. css navbar * { margin: 0; padding: 0; list-style: none; } body { font-family: Arial, Helvetica, sans-serif; font-size: 11px; margin: 10px; } .tab { width: 100%; padding: 5px; background: #fff; color: #000; cursor: pointer; font-weight: bold; border-bottom: 1px solid black; position: relative; } .tab:hover { background: #a0a0a0; }

HTML5 / CSS3 Circle with Partial Border

為{幸葍}努か 提交于 2019-11-27 03:28:12
Is it possible to create a circle using only HTML5 / CSS3 which has a border that only goes part way around the circle? If not, what techniques can I use to accomplish this effect? I would prefer to use pure DOM elements, but if I have to I can draw on canvas or spin up an SVG. Ana Yes, it is possible - see this: demo .circle { position: relative; margin: 7em auto; width: 16em; height: 16em; border-radius: 50%; background: lightblue; } .arc { overflow: hidden; position: absolute; /* make sure top & left values are - the width of the border */ /* the bottom right corner is the centre of the

How can I maintain proper boundaries on CSS triangles when hovering with cursor?

廉价感情. 提交于 2019-11-27 03:21:11
问题 Is it possible to fix the hovering on http://jsfiddle.net/2AXhR/ so that the correct triangle is activated on hover instead of its sometimes adjacent one? Sometimes the wrong triangle is activated because each triangle element's bounding area is not actually a triangle, but a rectangle, so even though the cursor may appear to be on top of one triangle, it is actually on top of another one that overlaps and has a higher z-index. <style type="text/css"> .t { position:relative; top:55px; left

How to make a circle around content using CSS?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 03:03:34
Like this With only this code <span>1</span> http://jsfiddle.net/MafjT/ You can use this css span { display: block; height: 60px; width: 60px; line-height: 60px; -moz-border-radius: 30px; /* or 50% */ border-radius: 30px; /* or 50% */ background-color: black; color: white; text-align: center; font-size: 2em; } Because you want a circle, you need to set the same value to width, height and line-height (to center the text vertically). You also need to use half of that value to the border radius. This solution always renders a circle, regardless of content length. But, if you want an ellipse that

div slanted in 2 directions

北城以北 提交于 2019-11-27 02:57:10
问题 Is it possible to create the following shape as a DIV in CSS . The browser support is not important. 回答1: You cannot skew an element like this directly, you'll need to use two elements (or generated content) and hide certain overflow to make the flat bottom edge: http://jsfiddle.net/6DQUY/1/ #skew { height: 240px; overflow: hidden; } .skew { background: #000; display: inline-block; height: 300px; width: 500px; margin-top: 100px; transform: skew(-8deg, -8deg); } Note: I removed the cross

Blocky gradient effect in CSS3

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 02:15:59
Is it possible to make the below gradient look more "blocky", so that instead of switching from green to red gradually, it's done in steps like the below picture? Desired effect: Currently: #gradients { background-image: -webkit-gradient(linear, left bottom, right bottom, color-stop(0, #00FF00), color-stop(0.5, #FFFF00), color-stop(1, #FF0000)); background-image: -o-linear-gradient(right, #00FF00 0%, #FFFF00 50%, #FF0000 100%); background-image: -moz-linear-gradient(right, #00FF00 0%, #FFFF00 50%, #FF0000 100%); background-image: -webkit-linear-gradient(right, #00FF00 0%, #FFFF00 50%, #FF0000