css-shapes

How to create fluid trapezoid image with css?

谁说胖子不能爱 提交于 2019-11-27 08:22:15
I am working on a website on which we have use parallax effect. In that there are some images which are triangle shaped, like this & the image is transparent because it overlaps the above DIV. I am trying so many things with css. but didn't get the desired result. I achieve that desired result with fixed width. Check this http://jsfiddle.net/eJ7Sf/2/ but does not work with fluid width. Check what i still try but didn't work http://jsfiddle.net/ceGGN/3/ http://jsfiddle.net/eJ7Sf/1/ NOTE: i know about css3 MASK property but it's not work in firefox previous browsers. I want the capability till

Transparent Border showing background image

前提是你 提交于 2019-11-27 08:04:04
问题 I have this: I want to achieve this: I have a big outer div (with red background) and a smaller-inner div (with green background). The small div has a border, I want the border to appear as transparent to show the behind background. Is this achievable with HTML/CSS? 回答1: You can achieve the transparent border showing background image using a pseudo element. The red background is the border of the pseudo element and the transparent border is created by the gap between the element's background

How do I create a 'Parallelogram' shape in css with a straight side? [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-11-27 08:02:47
问题 This question already has an answer here: How to bevel the corner of a block div? 4 answers I am trying to create a Parallelogram with a straight right side in css but so far I am struggling to achieve this. I am using css ... -webkit-transform: skew(-18deg); -moz-transform: skew(-18deg); -o-transform: skew(-18deg); ...to 'skew' the rectangle to create the Parallelogram. I am wondering if the right side can be made straight? Would it require :before and :after in the css? Any help of this

How to create a curved speech bubble?

让人想犯罪 __ 提交于 2019-11-27 07:50:19
问题 I'm trying to make a curved speech bubble out of a div, like this: This is what I've tried, but it doesn't really work: .userMsgBottom{ position: relative; display: inline-block; max-width: 260px; height: auto; word-wrap: break-word; background-color: #2e7384; margin-top: 12px; margin-left: 8px; margin-right: 8px; padding: 7px; border-radius: 6px; } .userMsgBottom:after { content: ""; position: absolute; bottom: 0px; right: 5px; width: 70px; height: 30px; background-color: #2e7384; transform:

How to achieve chamfered CSS Border Corners rather than rounded corners?

半世苍凉 提交于 2019-11-27 07:41:23
With the CSS border-radius property I can have a curvy, rounded border corner at the end. .boxLeft{ border-right: 1px dashed #333; border-bottom: 1px dashed #333; border-radius: 0 0 10px 0; } .boxRight{ border-left: 1px dashed #333; border-bottom: 1px dashed #333; border-radius: 0 0 0 10px; } But I want a border corner like the image below. If I have two boxes (Yellow & Pink) meeting each other and I want a harsh corner at the bottom meeting point (dotted corner), what should I do? Is that possible using CSS? thordarson Here's a way, although it does have some shortcomings, like no borders and

How can I make a div with irregular shapes with css3 and html5?

别等时光非礼了梦想. 提交于 2019-11-27 07:41:08
I'm wondering is there any possibility to build div with irregular shapes, something, similar to this (e.g. Greenland, Europe, Africa). I want to create map like here with using CSS3 and HTML5. Here is link to an example image: Navaneeth Elements have always been rectangular. Still, you can simulate other shapes by drawing CSS shapes within the rectangular division and by arranging different divisions (with z-index, etc.). This will help you: http://css-tricks.com/examples/ShapesOfCSS/ What you have there looks like a grid, which you can obtain either with many gradients on a div, either with

Square DIV where height is equal to viewport

只愿长相守 提交于 2019-11-27 07:23:41
I need to create a DIV where width=height , and height=100% of the viewport (which, obviously, is variable). In other words, a perfectly square DIV that calculates it's dimensions based on the height of the viewport . Elements within that DIV will take their dimensions as percentages of the parent-DIV's height & width. It seems to me like this should be simple to do in CSS , but I've gotten stuck with it! Any pointers would be much appreciated. You can do this with jquery (or pure javascript if you prefer). With jquery: <div id="square"> </div> $(document).ready(function(){ var height = $

How can I create custom tooltips with css pseudoelements

六月ゝ 毕业季﹏ 提交于 2019-11-27 07:15:39
问题 I am reading css-tricks and in the end I can see the following. Using an HTML5 data attribute, then pulling that attribute in and styling it as a pseudo element, we can create completely custom tooltips through CSS. The problem is that the link inside of the article is dead, and I am not such a good html/css guy to be able to understand how to do this. Can anyone help? 回答1: JSFiddle is here. Note: The original content is here. HTML <p>Vestibulum mollis mauris <a href="#" class="tooltip" title

Making jagged triangle border in CSS

不羁的心 提交于 2019-11-27 07:07:53
I have a shape with an edge like this in Photoshop: Is it possible to make the repeated triangles as a border with CSS? extramaster You can use css3 gradients to create a zig-zag patterned background, use the after css pseudo to apply it like a border. .header{ color: white; background-color: #2B3A48; text-align: center; } .header:after { content: " "; display: block; position: relative; top: 0px; left: 0px; width: 100%; height: 36px; background: linear-gradient(#2B3A48 0%, transparent 0%), linear-gradient(135deg, #272220 33.33%, transparent 33.33%) 0 0%, #272220 linear-gradient(45deg, #272220

Center Triangle at Bottom of Div

旧巷老猫 提交于 2019-11-27 06:47:56
I am trying to have a triangle/arrow at the bottom of my hero but it is not responsive and doesn't work on mobile very well as the triangle floats off to the right and is not absolutely centered anymore. How could I keep the triangle positioned in the absolute center at the bottom of the div at all times? Example code here: http://jsfiddle.net/SxKr5/1/ HTML: <div class="hero"></div> CSS: .hero { position:relative; background-color:#e15915; height:320px !important; width:100% !important; } .hero:after, .hero:after { z-index: -1; position: absolute; top: 98.1%; left: 70%; margin-left: -25%;