css-transforms

Change text color black to white on overlap of bg

我只是一个虾纸丫 提交于 2019-11-30 11:44:00
I have a div that is positioned absolute with a background color gradient. I have this text on it that I want to change to the color white as I scroll the text up. I'm using the 'mix-blend-mode' property to achieve this currently but I can't find any setting that will turn the text from black to white. Has anyone done this before or can think of a trick I can do? .bg-container { position: fixed; top: -30px; left: 0; width: 100px; height: 100px; } .gradient-background { position: absolute; top: 0; left: 0; width: 100px; height: 200px; background-image: linear-gradient(to bottom, rgb(100, 182,

Scale/zoom a DOM element and the space it occupies using CSS3 transform scale()

对着背影说爱祢 提交于 2019-11-30 10:55:29
问题 In the middle of my page I have a div element with some content in it (other divs, images, whatever). <div> before </div> <div id="content-to-scale"> <div>something inside</div> <div>another something</div> </div> <div> after </div> I would like to scale that element (content-to-scale) and all it's children. Seems like a job for CSS3 transform's scale operation. However, the problem is that this is a transform on the visualization of that element hierarchy only, it doesn't change the amount

Rotating CSS cube on fixed axes

空扰寡人 提交于 2019-11-30 09:02:31
问题 I have a cube constructed using CSS. It's made of 6 faces and each face is transformed to form one face of the cube, and all the 6 faces are under one <div> with the class .cube . Any rotation I do to the cube is done on this enclosing cube class. I want the cube to rotate based on mouse drag input. So far it kinda works. I just translate x and y mouse movement into cube rotation about the x and y axes. But there's one major problem with this. I perform the rotation as a simple transform:

why -webkit-transform: translate3d(0, 0, 0) messes up with fixed childs

烂漫一生 提交于 2019-11-30 08:23:30
I've been trying for the last few hours to figure out how come a child element was positioning against its parent and not the screenport even though it's positioned as 'fixed'. Very luckily, I stumbled across the mentioning that -webkit-transform: translate3d(0, 0, 0) on the parent can make things go awry. I'm using bootstrap framework and so they indeed put this property on the .navbar-fixed-top class which one of parent elements had. Once I removed it the child started to position agains viewport. So I have two questions: Why does -webkit-transform: translate3d(0, 0, 0) do these nasty things

GIve css3 rotate to a DIV in Chrome then the background-attachment:fixed creating bug

非 Y 不嫁゛ 提交于 2019-11-30 07:50:44
问题 My background-attachment:fixed is working fine. But when I define CSS3 rotate on that DIV and scroll down then background-attachment:fixed stops working. Check this http://jsfiddle.net/P3jS4/ Right now I am working on chrome18 . When you remove the rotate css then the background-attachment:fixed works fine. http://jsfiddle.net/P3jS4/2 回答1: This is not a bug. You're trying to do something the spec hasn't defined yet. It says in the comments: What do fixed backgrounds do in transforms? They

Is there polyfill for css transform property in IE8

℡╲_俬逩灬. 提交于 2019-11-30 07:45:02
I have the following mixin for cross-browser transform: .transform (...) { -webkit-transform: @arguments; /* Chrome, Opera 15+, Safari 3.1+ */ -moz-transform: @arguments; /* Firefox 3.5+ */ -ms-transform: @arguments; /* IE 9 */ -o-transform: @arguments; /* Opera 10.5+ */ transform: @arguments; /* Firefox 16+, IE 10+, Opera */ } .translate(@x:0, @y:0) { .transform(translate(@x, @y)); } And apply it something like the following: #main { .translate(280px, 0); } But it's not wotk in IE8 and Opera mini . Is there some fallback, polyfill or any for supporting it in therese browsers? There are a few

Shape resembling a compass pointer or inner part of a Safari logo

痞子三分冷 提交于 2019-11-30 07:24:46
I am trying to make the below shape using only CSS. I know that achieving this shape using an image or SVG would be a lot easier but I am trying to achieve it with CSS for a proof of concept. The below is the code that I have tried so far. It creates a diamond shape by using transform: rotate(45deg) but the diagonals are of the same length whereas the shape that I need has one very long diagonal and another very short. .separator{ background: #555; top: 40px; padding-top: 0px; margin: 0px 40px; height: 100px; width: 100px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg);

How to create a sphere in css?

左心房为你撑大大i 提交于 2019-11-30 07:14:05
I have trying to create a 3D sphere using just pure css, but I've been unable to generate the shape required. I've seen a cylinder but I can't find any reference to creating an actual sphere . My current code looks like: .red { background-color: red; } .green { background-color: green; } .blue { background-color: blue; } .yellow { background-color: yellow; } .sphere { height: 200px; width: 200px; border-radius: 50%; text-align: center; vertical-align: middle; font-size: 500%; position: relative; box-shadow: inset -10px -10px 100px #000, 10px 10px 20px black, inset 0px 0px 10px black; display:

How to reset CSS3 *-transform: translate(…)?

a 夏天 提交于 2019-11-30 06:23:30
问题 How can I reset CSS transform properties CSS translate value? Say I have: div.someclass { -webkit-transform: translate3d(0, -50%, 0); -moz-transform: translate(0, -50%); -ms-transform: translate(0,- 50%); -o-transform: translate(0, -50%); transform: translate3d(0, -50%, 0); } Then how do I clear all transformations/translations? Should I use: translate(0, 0); / translate3d(0, 0, 0); or transform:auto; ? 回答1: As per the MDN documentation, the Initial value is none . You can reset the

How do I use the matrix transform and other transform CSS properties?

送分小仙女□ 提交于 2019-11-30 06:14:53
问题 When using the transform property in CSS, one of the possible methods is the matrix method that requires 6 input fields. The CSS code would look something like... #test{ transform: matrix(1, 0, 0, 1, 0, 0); } There are also a couple other variations (depending on the browser)... -ms-transform: matrix(1, 0, 0, 1, 0, 0); -webkit-transform: matrix(1, 0, 0, 1, 0, 0); I know that the values shown above are the stock values for an object, but what do all the numbers mean or do? 回答1: The