css-shapes

Semi-oval with CSS

早过忘川 提交于 2019-12-01 03:10:53
I'm trying to create a mix between an oval and a semi-circle. Semi-circles can be created as such in CSS: .halfCircle{ height:45px; width:90px; border-radius: 90px 90px 0 0; -moz-border-radius: 90px 90px 0 0; -webkit-border-radius: 90px 90px 0 0; background:green; } And ovals can be made like this: .oval { background-color: #80C5A0; width: 400px; height: 200px; margin: 100px auto 0px; border-radius: 200px / 100px; } But how can I make a semi-oval? Here's my attempt so far. The problem that happens is I've got flat tops, found here . Thanks! I've updated your demo with one possible solution:

Pseudo-element background image doesn't appear

我与影子孤独终老i 提交于 2019-12-01 02:57:20
I have a div element with a triangle-border and I'm trying to place an image above it using an ::after pseudo-element with background-image . The method doesn't work though. However if I'm trying to set content: "asd"; , the text appears correctly. Basically I just want to have a house image above that triangle. Here's the HTML code: <div id = "estatecorner" class = "house"></div> And here's the CSS: #estatecorner { position: absolute; right: 0px; width: 0; height: 0; border-style: solid; border-width: 0 80px 80px 0; border-color: transparent #67b2e4 transparent transparent; } #estatecorner

CSS oval shape cut out from div

≡放荡痞女 提交于 2019-12-01 02:54:31
问题 The above image is what i'm trying to create but am having some difficulties with the oval shape. An explanation: The menu bar is a div with a slight linear gradient (dark grey to transparent lighter grey) The company logo image has a transparent bg and will sit 'ontop' of the menu bar The oval cutout will need to match the oval of the logo and have a transparent gap between that will show the background colour (this changes on each page, orange is just an example) I've tried and failed many

Generate arrow line with CSS [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-01 02:13:26
问题 This question already has answers here : Border with a transparent centred arrow (3 answers) Closed 3 years ago . I am trying to generate a straight horizontal line with a breakdown in the middle to display an arrow. The idea is that the content displayed under the line will provide details about the content displayed above the line. Here is what the line should look like: I am trying to generate this with pure HTML and CSS (no bitmap images). Use of Font Awesome is acceptable if it ends up

CSS triangle :before element

∥☆過路亽.° 提交于 2019-12-01 02:10:59
I'm using bootstrap, trying to make a div have a CSS triangle before it. http://jsfiddle.net/B2XvZ/11/ Here is my non-working code: .d:before { width: 0px; height: 0px; border-style: solid; border-width: 10px 15px 10px 0; border-color: transparent #dd4397 transparent transparent; } The way I'd like it to look is for there to be a pink left-pointing triangle right before the text "this", with no gap between it and the div. I've tried to do this by floating the elements also, with no success. You need to specify the content property. For positioning, add position:relative to the parent, and then

How to achieve a trapezoid in CSS3?

﹥>﹥吖頭↗ 提交于 2019-12-01 01:58:15
I'm trying to achieve the following container in CSS3. I tried with transform: skewY but i don't have the desired result. I know that I can achieve it with 3d Transforms, but I have in mind our lovely Internet Explorer. Also I tried to play with pseudo elements but I lost it. Is there any css rule that I can, lets say, increase the height of the top and bottom right corners? JSFiddle Thank you You could use skewed pseudo elements for this (ensuring the skews are on the pseudos, and not the element itself): div { position: relative; height: 200px; width: 80vw; margin: 10vw; } div:after {

Custom scoop border style - responsive, Custom & dynamic border style - fit in height, Custom border corner - double stroke [closed]

天涯浪子 提交于 2019-12-01 01:48:38
Is there any way to make custom scoop border style in CSS or jQuery? Like the image below: Here's a fiddle ... http://jsfiddle.net/zjw3pg2e/5/ Does this work for you? body { background: #D8D8D8; } .corner { background:white; height:20px; width:20px; position:absolute; } #sw { left: -2px; bottom: -2px; border-radius: 0px 20px 0px 0px; border-top: 2px solid white; border-right: 2px solid white; background:#D8D8D8; } #se { right: -2px; bottom: -2px; border-radius: 20px 0px 0px 0px; border-top: 2px solid white; border-left: 2px solid white; background:#D8D8D8; } #nw { left: -2px; top: -2px; border

Rounded arrow shape with gradient fill

不羁的心 提交于 2019-11-30 23:50:14
For my online game UI, I decided to make Hill Climb Racing (Android Game) 's buttons. This is is what I have presently : body { color: white; font-family: Impact, fantasy; font-size: 40px; line-height: 100px; text-align: center; } .rect { height: 100px; width: 280px; background: #545D60; border-radius: 20px 50px 50px 20px; position: relative; } .rect:before { background: #545D60; content: ""; position: absolute; top: 6px; left: 195px; height: 0px; width: 0px; border-radius: 30px 10px; border: 44px solid #545D60; transform: rotate(45deg); } <div class="rect">NEXT</div> The problem lies with

Add inner corner curved border to active menu

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 23:37:33
问题 I am trying to create an inner curved border for active/selected menu. Below snippet is so far the best I can do, the square corner shouldn't be visible. Solutions from google doesn't seem to help... Please help me play with it. Thanks guys! FIDDLE HERE. body { background:#eee;width:90%;margin:20px auto } ul { margin: 0; padding: 0; } ul li { display: inline-block; list-style: none; position: relative; vertical-align:bottom; } ul li a { padding: 10px 15px; display: block; line-height: 25px;

Is it possible to have a non-rectangular div?

风流意气都作罢 提交于 2019-11-30 23:20:37
问题 I need to shape ONE div tag in the following shape: Is it possible to make it cross browser? I don't necessarily need rounded corners. I need it so I can change the color of the borders of the whole div on hover, so I assume it can't be achieved by using two div s. 回答1: Yeah, you can do that using HTML and CSS like this: http://jsfiddle.net/broofa/364Eq/ It's essentially using three divs to aggregate the mouse events, like so: <div id="outer"> <div class="inner"></div> <div class="inner"><