clip-path

Multiple clip-paths

左心房为你撑大大i 提交于 2019-12-05 17:09:13
I'm trying to make a website layout ideally consisting of multiple divs, where I'd like each one to have a slanted bottom, going into the one below. Here's a look at the mockup so far: @charset "utf-8"; /* CSS Document */ * { margin: 0; font-size: 10px; } .red { position: relative; height: 500px; background: red; background-size: cover; background-repeat: no-repeat; background-position: center; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 5vw)); } .blue { height: 500px; margin-top: -5vw; background: blue; } .green { height: 500px; margin-top: -5vw; background: green; } .orange {

Why does svg <use xlink:href=“#”/> referencing an element with clip-path not work?

微笑、不失礼 提交于 2019-12-04 08:42:52
When implementing an SVG sprite, an <svg> element is created and svg elements are referenced via the <use> element. The containing <svg> element is then hidden using style="display: none;" The clip-Path attribute does not render, but the path does. This leaves my path looking different from how I want it to. How do I use an svg <use xlink:href="#"/> referencing an element with clip-path? I used grunt-svg-store to create my svg sprite, but have simplified this example for Q&A format https://css-tricks.com/svg-sprites-use-better-icon-fonts/ <svg id="svg-test" style="display: none;"> <clipPath id

CSS中clip-path属性的使用

只谈情不闲聊 提交于 2019-12-04 03:58:08
clip-path的使用 polygon 值为多个坐标点组成,坐标第一个值是x方向,第二个值是y方向。 左上角为原点,右下角是(100%,100%)的点。</p> body { background-color: #000; } .fa { border: 1px solid #fff; color: yellowgreen; padding: 10px; margin: 10px; } .fa>div { width: 110px; height: 110px; background-color: yellowgreen; margin: 20px auto; } .polygon1 { clip-path: polygon(50% 0px, 100% 100%, 0px 100%) } .polygon2 { clip-path: polygon(0px 50%, 50% 0, 100% 50%, 50% 100%) } .polygon3 { clip-path: polygon(0% 60%, 20% 0%, 60% 0%, 40% 60%) } <div class="fa"> <p>polygon</p> <p>值为多个坐标点组成,坐标第一个值是x方向,第二个值是y方向。</p> <p>左上角为原点,右下角是(100%,100%)的点。</p> <div class=

d3.js brush fill color histogram

放肆的年华 提交于 2019-12-04 03:38:45
i have created some histogram with d3.js . I managed to change fill color of rect depending on the position of the brush . But i would like to change the color inside a rect . For example if the brush start is in the middle of the rect i would like to have my rect with two color. At the moment this is what i have : And this is what i would like to have : I have seen some examples like Here . I'm new to d3 and i try to understand the code. I see that they use clip-path that certainly hide the background bar when their is no brush and show them when their is one depending on the range of the

Reduce spacing between two clipped images

試著忘記壹切 提交于 2019-12-04 01:38:45
问题 I am using clip-path to clip two images. The result is Everything is fine but I want to reduce the spacing between these images just like this .clip-wrap { display: inline; } .element { -webkit-clip-path: polygon(0 100%, 0 0, 100% 0, 60% 100%); clip-path: polygon(0 100%, 0 0, 100% 0, 60% 100%); } .element2 { -webkit-clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); } <div class="clip-wrap"> <img src="http://karenmenezes.com/shapes

How to make clip-path work on Microsoft Edge?

感情迁移 提交于 2019-12-04 00:05:18
While making a clipped header for Firefox and Microsoft Edge(ME), I used clip-path . It works in Firefox just by putting clipPath element inside an SVG element and a clip-path style inside the HTML element. When I open this same code on ME, it doesn't show anything. html,body,header { margin:0px; height:100%; font-family: Arial Unicode MS; } button:hover { transition:background-color 0.5s linear; } a:hover,li:hover { opacity: 0.5; transition:opacity 0.4s linear } #header { width: auto; height: 100%; } /************************** BANNER-SLIDER-HEADER BEGIN ************************/ .carousel,

Trapezoid Sections, Clipping Background Images

前提是你 提交于 2019-12-02 07:06:04
I am trying to create a web layout with trapezoid shapes like in the image attached. With the addition that each section has a background-image that fills the background with cover or a like result. The first section (dark blue) I have achieved simply using skew and two divs as demonstrated below. However, I can't create the following section, where it skews two ways. I have attempted using clip-path without luck. Then the final section needs to square-off again. HTML <section id="my_section"> <div id="my_section_bg"></div> <div id="my_section_content"> <!-- any typical content, text/images

SVG rounded triangle with gradient overlay and background image

痞子三分冷 提交于 2019-12-01 08:25:51
问题 I have the below code that is creating a simple rounded triangle shape with a purple gradient. I'm trying to insert a background image that will fill the shape underneath the gradient to create a similar effect to the screenshot below: What I'm looking to achieve: My code so far (doesn't show the image): <svg width="100%" viewBox="0 0 1440 742" version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml

Invert colored text related background

这一生的挚爱 提交于 2019-12-01 08:19:09
I want to invert text color based on the background of the text, like in this image: . So I've tried the following code, but it didn't work: #warp, #text, #tri { position: absolute; top: 0; left: 0; width: 150px; height: 150px; z-index: 1; } #warp { background-color: orange; } #text { text-align: center; z-index: 3; } #text h1 { margin: 0; line-height: 150px; mix-blend-mode: difference; } #tri { background-color: black; clip-path: polygon(0 0, 0 100%, 99.8% 150px); -webkit-clip-path: polygon(0 0, 0 100%, 99.8% 150px); z-index: 2; } <div id="warp"> <div id="text"> <h1>TEXT</h1> </div> <div id=

Reduce spacing between two clipped images

夙愿已清 提交于 2019-12-01 08:12:57
I am using clip-path to clip two images. The result is Everything is fine but I want to reduce the spacing between these images just like this .clip-wrap { display: inline; } .element { -webkit-clip-path: polygon(0 100%, 0 0, 100% 0, 60% 100%); clip-path: polygon(0 100%, 0 0, 100% 0, 60% 100%); } .element2 { -webkit-clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); } <div class="clip-wrap"> <img src="http://karenmenezes.com/shapes-polygon/clip-demo.jpg" alt="demo-clip-css" class="element" width="150" height="150"> </div> <div class=