css-shapes

How to create CSS heart? / Why is this CSS creating a heart shape?

非 Y 不嫁゛ 提交于 2019-11-27 02:14:50
问题 I've found the following CSS in one of the answers here on SO and I was wondering why does it create the desired heart shape: #heart { position: relative; width: 100px; height: 90px; } #heart:before, #heart:after { position: absolute; content: ""; left: 50px; top: 0; width: 50px; height: 80px; background: red; border-radius: 50px 50px 0 0; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg);

Add outward curving border to elements like this: ◝◟___◞◜

白昼怎懂夜的黑 提交于 2019-11-27 02:06:58
Problem My navbar looks like this: HTML and CSS nav { width: 1040px; } nav ul { display: block; list-style-type: none; height: 40px; border-top: 3px solid #222; } nav ul li { width: 130px; display: inline-block; line-height: 40px; text-align: center; font-size: 16px; font-family: Vollkorn; font-weight: 400; } nav ul li a { display: block; text-decoration: none; color: #333; } nav ul li a:hover, nav ul li a:focus { color: #000; box-shadow: 0px 0px 2px black; border-radius: 10px; border: 2px solid #222; border-top: 0px; transition: 0.2s ease all; } <nav> <ul> <li><a href="#">Home</a> </li> <li>

Flat sharp corner or beveled corners

会有一股神秘感。 提交于 2019-11-27 02:03:31
问题 Is there any way to create a sharp flat corner with CSS and HTML? Something like this: ____ / \ | | \____/ 回答1: Look here. There you find all you need: http://css-tricks.com/examples/ShapesOfCSS/ Edit In case the link goes lost: CSS #octagon { width: 100px; height: 100px; background: red; position: relative; } #octagon:before { content: ""; position: absolute; top: 0; left: 0; border-bottom: 29px solid red; border-left: 29px solid #eee; border-right: 29px solid #eee; width: 42px; height: 0; }

Slanted diagonal line in html or css?

橙三吉。 提交于 2019-11-27 02:00:03
I want to make a Table like this is it possible to add a slanted diagonal border in table? Based on CSS3 linear-gradients solution except that the angle is not hard coded: table:nth-of-type(1) td { background-image: linear-gradient( to top right, white 48%, black, white 52% ); } table:nth-of-type(2) td { background-image: linear-gradient( to top right, papayawhip calc(50% - 1px), black, papayawhip calc(50% + 1px) ); } /* for testing */ table { border-collapse: collapse; margin-top: 1em; margin-bottom: 1em; } td:nth-child(odd) { width: 10em; } td:nth-child(even) { width: 20em; } <table border=

Creating a 'New' spiky label with 24 or above point burst

牧云@^-^@ 提交于 2019-11-27 01:58:43
I am trying to make a point burst thing like the image below: Currently, I have tried this using pseudo elements, however, I was only able to generate a 12 point burst and does not reflect that which is displayed within the image. Is there anyway to create a point burst with only a few elements? Below is the code I have used to attempt this solution: div{ width:100px; height:100px; background:grey; transform:rotate(45deg); margin:50px; } div:after{ position:absolute; content:""; background:grey; width:100px; height:100px; transform:rotate(135deg); } div:before{ position:absolute; content:"";

How to add border to a container with transparent gaps in between

核能气质少年 提交于 2019-11-27 01:37:18
Here is an image of the design which I am trying to achieve with only CSS. How do I achieve such border for the container div so that I can place transparent logo and text in between the gaps. This design will go on a video background. The black background is just for illustration purpose. So far I have tried to achieve something like this as a test: body { background: black; } p { color: #ffffff; font-size: 16px; text-align: center; padding: 30px; } .steps-frame-1 { margin-top: 60px; width: 50%; height: 200px; margin-left: auto; margin-right: auto; } .steps-frame-1 { border: 0; position:

CSS folded corner effect transparent background

时光怂恿深爱的人放手 提交于 2019-11-27 01:25:05
问题 I have this Code for folded corner using CSS: body { background-color: #e1e1e1 } .note { position: relative; width: 480px; padding: 1em 1.5em; margin: 2em auto; color: #fff; background: #97C02F; overflow: hidden; } .note:before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 16px 16px 0; /* This trick side-steps a webkit bug */ border-style: solid; border-color: #fff #fff #658E15 #658E15; /* A bit more verbose to work with .rounded too */ background: #658E15; /* For when

Rounded side, not rounded corners

此生再无相见时 提交于 2019-11-27 01:19:11
问题 I'd like to create a shape like the one displayed below entirely in CSS. As you can tell, it would take a bit more tweaking than simply applying rounded corners... Can it be done? 回答1: Here is the jsfiddle: http://jsfiddle.net/swqZL/ CSS for element div with class "figure": .figure { height: 400px; width: 200px; background-color: black; border-bottom-left-radius: 100%30px; border-bottom-right-radius: 100%30px; } Horizontal radius 100%, vertical radius 30px 回答2: <div style="background: black;

Arrow Box with CSS

烂漫一生 提交于 2019-11-27 00:58:12
How can I make this box in CSS? I've seen a few tutorials that teach how to create boxes with arrows, however, in my case, none of those tutorials are suitable. Hristo I created your element with the surrounding 1px border. I'm using one <div> element and taking advantage of the :before and :after pseudo-elements ( browser-support ). The main rectangle has a regular 1px border, but the triangle elements are essentially 2 triangles, one darker than the other. The lighter triangle sits on top of the darker triangle, which has the effect of hiding it, and is shifted slightly to the left to show

Count down timer with circular progress bar

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 23:17:59
I created an countdown timer. I got a border which is made circular. As the timer is tending towards zero, the circular border should change color with decrement in the seconds. I created the JSFIDDLE HTML <div class="outer"> <button class="btn btn-default btn-timer">0.00</button> </div> JS CODE var displayminutes; var displayseconds; var initializeTimer = 1.5 // enter in minutes var minutesToSeconds = initializeTimer*60; $("#document").ready(function(){ setTime = getTime(); $(".btn-timer").html(setTime[0]+":"+setTime[1]) }); $(".btn-timer").click(function(){ var startCountDownTimer =