css-shapes

Adding border to CSS triangle [duplicate]

三世轮回 提交于 2019-11-30 02:09:11
问题 This question already has answers here : CSS triangle custom border color (5 answers) Closed 4 years ago . I have a triangle <div class="triangle-left"></div> .triangle-left { width: 0; height: 0; border-top: 22px solid transparent; border-bottom: 22px solid transparent; border-right: 22px solid white; } How do I draw the outline of a CSS triangle, considering border itself is used to make the triangle? External divs? 回答1: One way to do it is the create an inner triangle which is smaller.

HTML and CSS Fluid Circle

廉价感情. 提交于 2019-11-30 01:53:34
问题 I am trying to create a fluid circle using HTML and CSS. I am almost done but as it should be fluid and content inside is dynamic, it's changing its shape from circle to oval and others. body { position: relative; } .notify { position: absolute; top: 100%; left: 20%; background: red; border: 2px solid white; border-radius: 50%; text-align: center; } .notify > div { padding: 20px; } <div class="notify"> <div> 12 </div> </div> Can you help me please? 回答1: The border-radius:50% hack which you're

hexagonal shaped cells in html [duplicate]

妖精的绣舞 提交于 2019-11-30 01:37:07
This question already has an answer here: Generate repeating hexagonal pattern with CSS3 7 answers Is there was a way to design a html block that is a hexagonal grid? Similar to that of a Bee hive. This looks more like a css styling task. You can use a large border which will get slanted and you can make triangular shapes on an element, fyi. Example: http://jsfiddle.net/pAGJG/ So you can make a <div class="hexagon"> with a top triangle, middle section, and bottom triangle, and make multiple hexagons. EDIT: Updated example: http://jsfiddle.net/rRDby/ It isn't a perfect hexagon but it gives you

Explain the usage of CSS3 in an Egg Shape

自古美人都是妖i 提交于 2019-11-30 01:35:40
问题 I am using CSS3 to build up random shapes. I am stuck on this Egg Shape. I checked upon the mathematics of Egg Shapes, which are composed by 2 circles with different radius. Yet I can't link this fundamental construction with the CSS buildup code here, especially the "border-radius" part. #egg { display:block; width:126px; /* width has to be 70% of height */ /* could use width:70%; in a square container */ height:180px; background-color:green; /* beware that Safari needs actual px for border

CSS 3 or svg wave in a background

牧云@^-^@ 提交于 2019-11-29 23:50:22
问题 How can I build a wave on a transparent image background ? Layout-Image: I need the wave in the white top background. 回答1: I slightly improved version of akshay's answer. This includes two separate options. OPTION 1 If aspect ratio doesn't have to be preserved, then the curve will change with width. http://jsfiddle.net/f6n73avk/2/ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" height="100" width="100%" viewBox="0 0 90 20" preserveAspectRatio="none"> <path d="M0 5 H5 C25 5 25 20 45 20

CSS3 Shapes - What's possible? [closed]

与世无争的帅哥 提交于 2019-11-29 22:07:21
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I'm looking at only latest gen browsers: IE9 (haven't really looked into this once much) FF4 Chrome10 Safari5 iOS 3.4 Opera? I know I can get squares and rectangles easy, circles and ellipsis with rounded borders (circles: W=H, ellipsis: W!=H). I know I can get slopes with border

Dotted top and bottom border shorter than text

时光怂恿深爱的人放手 提交于 2019-11-29 18:17:39
问题 I want to achieve border top and bottom like below image how can I achieve with CSS tricks? Challenge is I don't want entire width with border and it should be responsive too. Mobile version image is http://i.imgur.com/XZTW28N.jpg and it should work in desktop and mobile browser too. I tried with %width border but it's not working. I wrote below code but it's not 100% perfect answer for me. HTML: <h1>How it Works</h1 CSS: h1:before, h1:after { content: ""; height: 1px; background: linear

Can I make an irregular <div> shape using only CSS? [duplicate]

二次信任 提交于 2019-11-29 17:26:56
This question already has an answer here: How can I make a div with irregular shapes with css3 and html5? 4 answers I'd like to style a div in the shape of an irregular hexagon with all right angles (think the shape of Utah, but not necessarily that orientation). I've seen some questions on StackExchange regarding irregular shapes for buttons (people say to use an image), and using irregular shapes for triangles (people say to use clipping), but nothing so far on having an irregular shape with right angles, as a parent or child div. Is this possible using only a single div in CSS/3? This

How to scroll the content in the left and right direction on hitting an arrow in mobile view?

北城以北 提交于 2019-11-29 16:39:37
I have a fiddle which is working in a way that when I take it in the mobile view, the square boxes horizontally scroll. The CSS codes which I have used for that are: @media only screen and (max-width: 767px) { .product-all-contents { overflow-x: auto; } .product-contents .product{ min-width: 50.795%; margin: 0 2%; padding-top: 3.91%; padding-left: 3.91%; padding-right: 3.91%; } } Problem Statement: I am wondering what changes I should make in the fiddle so that when I hit arrows in the mobile view (as shown in the screenshot below marked by orange arrow sign) the content move towards the left

Add rounded borders to selected corners of an element

陌路散爱 提交于 2019-11-29 14:18:34
How could I go about constructing something like this with pure CSS? This is how far I've gotten so far: Fiddle I'm struggling with how to get that rounded corner there, even if I continue to add additional span s. CODE: body { background: #000; } .container { position: relative; width: 300px; height: 150px; margin: 10% auto; } .top-right { position: absolute; top: -10px; right: 0; width: 50px; height: 1px; background: white; border-radius: 5px; } .box { width: 100%; height: 100%; background: red; border-radius: 15px; display: flex; align-items: center; justify-content: center; } h3 { color: