css-shapes

Pure CSS star shape [duplicate]

爱⌒轻易说出口 提交于 2019-11-29 09:12:30
This question already has an answer here: How do CSS triangles work? 17 answers There are a lot of CSS shapes shown on CSS Tricks . I am particularly surprised by the star: How does the CSS below create this shape? #star-five { margin: 50px 0; position: relative; display: block; color: red; width: 0px; height: 0px; border-right: 100px solid transparent; border-bottom: 70px solid red; border-left: 100px solid transparent; transform: rotate(35deg); } #star-five:before { border-bottom: 80px solid red; border-left: 30px solid transparent; border-right: 30px solid transparent; position: absolute;

transparent strikethrought on text

£可爱£侵袭症+ 提交于 2019-11-29 07:41:46
问题 I need to implement a transparent strikethrought on text with CSS so I don't have to replace the <h1> tag by an <img> tag. I have managed to implement a line-through on the text with CSS but I can't make it transparent. The desired effect : What I have : body{ background: url(http://lorempixel.com/output/people-q-c-640-480-1.jpg); background-size:cover; } h1{ font-family:arial; position:relative; display:inline-block; } h1:after{ content:''; position:absolute; width:100%; height:2px; left:0;

Div with a transparent cut out circle [duplicate]

拥有回忆 提交于 2019-11-29 07:27:52
This question already has an answer here: Transparent half circle cut out of a div 8 answers Can I make a rectagle div with a half cut out circle using CSS? The half circle should be transparent and let the background show through. desired CSS shape : HTML : <div></div> CSS : div{ background : #448CCB; width:300px; height:300px; } in order to have the white cut out circle transparent and let the background show through it, you can use box-shadows on a pseudo element to minimize markup. In the following demo, the blue color of the shape is set with the box shadow and not the background-color

How to use skew only in the parent element?

别来无恙 提交于 2019-11-29 07:15:02
Is there any way to use skew only in a parent element? I need to create something like a 'diamond' as a mask and the child elements can't be affected. There is no way, in this case, to use png as a mask. Thanks in advance! It's really easy, you just need to unskew the thing for the children. Unskew means applying another skew transform, but of opposite angle this time. .parent { transform: skewX(45deg); } .parent > * { transform: skew(-45deg); } In general, if you apply a number of transforms on a parent element and you want the child elements to go back to normal, then you have to apply the

Three colors angled background color

好久不见. 提交于 2019-11-29 07:11:00
How could I achieve a background that looked similar to this image: Only 3 colors, angled from the top corner out like a sunray. Maybe sticking with a simple PNG or SVG background image would be a better approach. The effect can be achieved with CSS using pseudo-elements and transforms and the below is a sample snippet. But I don't think using CSS is the correct option for this. It would be better to use a PNG image. The snippet uses a couple of pseudo-elements with different background colors skewed at required angles to produce the three-color effect. .bg { position: relative; height: 200px;

Is a CSS Arch using border-radius possible?

旧巷老猫 提交于 2019-11-29 07:10:37
I'm trying to create an arch using just CSS. I've looked into various " inset border-radius " questions, but all of them show how to inset corners, not the middle section of an object. I'm looking for a way to inverse the middle of an object to create an arch like a bridge. Included is an example image to show the sort of thing I'm trying to achieve. Edit: An important part of this arch is that it will be placed over other objects. Simply whiting it out isn't a solution, rather just a temporary hack. See image below for more on that. You could accomplish with radial gradients. I’ve put an

How to make half-square background in css

落花浮王杯 提交于 2019-11-29 06:57:38
Is it possible to make in pure css background for half square like on the image. I know that it can be done with an image as background, but I need to use 5 different colours, and maybe in future the colours can be changed. web-tiki If your divs have fixed sizes, you can use borders to make two triangles as described in How do CSS triangles work? : div{ display:inline-block; border-top:100px solid red; border-right:100px solid grey; } <div></div> To make other sizes, colors, you need to tweak the border properties : div { display: inline-block; } div:nth-child(1) { border-right: 100px solid

How to get 'div' shaped as a flag with CSS

假如想象 提交于 2019-11-29 06:55:10
I want to add a label on some of my elements on a website and design for a label that is a flag with an inverted V-shaped cut at the bottom. So far I have this: HTML <div class="css-shapes"></div> CSS .css-shapes{ border-left: 99px solid #f00fff; border-right: 99px solid #f00fff; border-bottom: 39px solid transparent; } http://jsfiddle.net/yhexkm4u/2/ However, I need the background to be white and border around this shape in purple and 1px. I was trying to fit the same shape just in white inside of this one, but everything got messy and didn't go as expected. Maybe it is a wrong approach, but

Show border triangle in navbar using CSS

橙三吉。 提交于 2019-11-29 06:51:42
I am trying to create a nav bar with an arrow under the item hovered upon. Here's is what I am trying to make: For the arrow I have used the pseudo elements before and after . Here is some of the code: body { background: #FFFFFF; color: #FFFFFF; margin: 0px; padding: 0px; height: 100%; } .clear { clear: both; } .page-wrap { width: 980px; margin: 0px auto; height: 100%; } #main-menu { background: white; height: 55px; width: 100%; padding: 0px; margin: 0px; border-bottom: 1px solid black; } ul { font-family: Arial, Verdana; font-size: 18px; margin: 0; padding: 0; list-style: none; } ul li {

How do I draw an incomplete circle with CSS and in it how to put a picture?

我的梦境 提交于 2019-11-29 05:23:36
How do I create a circle with a cut through it using CSS and an image in it? An example of what I want is shown below.Need a crossbrowser solution and with css not html. You can do this by creating the circle using a pseudo-element and then skewing the container with overflow: hidden . The child pseudo-element is reverse skewed to make it appear as though it is not skewed at all. .shape { position: relative; height: 100px; width: 120px; overflow: hidden; -webkit-transform: skew(-45deg); -moz-transform: skew(-45deg); transform: skew(-45deg); } .shape:after { position: absolute; content: ''; top