css-shapes

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

ⅰ亾dé卋堺 提交于 2019-11-28 10:53:58
问题 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

Oblique or twisted border shape

独自空忆成欢 提交于 2019-11-28 10:37:59
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. 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"> <path d="M0,0 h200 l-15,15 l15,15 h-200 l15,-15z" stroke="black" stroke-width="2" fill="none" /> </svg> <div

How to code an arrow using css

心不动则不痛 提交于 2019-11-28 10:11:53
问题 Hi guys I'm trying to code an arrow like this in css, I'e viewed examples on codepen, but now I'm thinking whether it is actually possible? 回答1: For arrow and lines i have use border .content { margin-top: 30px; position: relative; border: 2px solid black; border-bottom: 2px; border-radius: 5px; width: 200px; height: 40px; } .content:before, .content:after, .center:before { content: ''; width: 0; height: 0; border-width: 8px 8px; border-color: #000 transparent transparent transparent; border

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

别说谁变了你拦得住时间么 提交于 2019-11-28 10:02:34
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:5px; } .t div { position:absolute; width: 0px; height: 0px; border-style: solid; border-width: 0 100px

div slanted in 2 directions

回眸只為那壹抹淺笑 提交于 2019-11-28 09:28:23
Is it possible to create the following shape as a DIV in CSS . The browser support is not important. 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 browser definitions for better readability. UPDATE: This would be a more fluid example which resizes in set

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

蓝咒 提交于 2019-11-28 09:13:03
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); -webkit-transform-origin: 0 100%; -moz-transform-origin: 0 100%; -ms-transform-origin: 0 100%; -o

Box with a triangle like a chat

穿精又带淫゛_ 提交于 2019-11-28 08:08:18
问题 I want to make with CSS a rectangular box followed by a little triangle, like this. And i've done it but i would like the same output with the ":after". I've tried but i can't print anything. p { display:inline-block; padding:5px 6px 8px 6px; border-radius: 6px; float: right; margin-right: 40px; color:black; background-color:#146f79; } span { position:absolute; margin-top:-6px; margin-left:-5px; border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 12px

Flat sharp corner or beveled corners

霸气de小男生 提交于 2019-11-28 07:49:13
Is there any way to create a sharp flat corner with CSS and HTML? Something like this: ____ / \ | | \____/ 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; } #octagon:after { content: ""; position: absolute; bottom: 0; left: 0; border-top: 29px solid red; border

Separate 2 div's with slope line

左心房为你撑大大i 提交于 2019-11-28 07:44:17
问题 i want to seperate 2 floating div's with a slope line, they got different background colors. Example here: HTML markup: <div id="wrap"> <div id="one"></div> <div id="two"></div> </div> i allready tried to rotate them (as u can see in the jsFiddle): #wrap div { -moz-transform: rotate(20deg); -ms-transform: rotate(20deg); -o-transform: rotate(20deg); -webkit-transform: rotate(20deg); float:left; width:50%; height:200px; } http://jsfiddle.net/F6DgA/ Also i tried smth. with overflow:hidden : http

Re-sizing a cube

拜拜、爱过 提交于 2019-11-28 07:27:37
问题 I have a set of codes from the cube created using CSS. However, how do I resize this into a bigger cube (for example, 200px)? I have tried but everytime I try doing it, it goes out of position.. .mainDiv { position: relative; width: 206px; height: 190px; margin: 0px auto; margin-top: 100px; } .square { width: 100px; height: 100px; background: #c52329; border: solid 2px #FFF; transform: skew(180deg, 210deg); position: absolute; top: 43px; } .square2 { width: 100px; height: 100px; background: