Okay so this is very strange. I have a an absolute positioned image and on top of it is a PNG gradiant.
Based on the normal thought and previous post, if i set the absolute – positioned image z-index to -1 and make the layer with the png gradiant set a position: relative then it will happen what it was supposed to happen, the gradiant will cover the image. But what if we have this. see the 2 attached examples
The left image is having this CSS:
While the right image is having the same but with z-index: 1. If we remove z-index from the image @ all, then it wont show because of the underlying layer (remove the property). But if you look closely, the image is something on WHITE background so even with absolute positioning the only thing i can think off that makes it look like it “Multiplied” like in Photoshop is browsers ability to calculate png transparency and fill-options.
Of maybe i’m just silly and i am missing something very important but so far, and i cant find enough time to test this in a controlled environment, but so far this stuff works and i am quite happy with this situation
Later Edit: I’m silly, it was a number of factors, Gradiant transparency still works but only that. So Basically what you read in the last post… damn and i got excited about this
oh boy.
Tags: CSS, Photoshop, XHTML/CSS, z-index goodies
Categories: XHTML/CSS
Posted By: Dinulescu Alexandru Adrian
Last Edit: 06 Mar 2010 @ 08:23 PM
Evening All
How many times it happend that you got a design to cut/slice from a designer only (or you yourself are a designer) only to find out that the background of the PSD is unequal on both sides, for example you have a curbed line in the middle, and on the left the repeating line is placed on top while on the right side it goes in the middle. Something like this:
Notice the marked areas, well i found a pretty awesome and easy to implement solution. You slice the marked images and you do the following. When you have your main page container, as it’s siblings you create 2 new divs, bgHelperLeft and bgHelperRight and you style them something like this
Since you used z-index: -1; then it means that it wont overlap any of your center images, absolute positioning means that it will stay there, and those widths means that they will meet BEHIND your center area so the user wont see the binning point, all creating a cursive flow from one side of the screen to the other side of the screen.
It works on all major browsers so this is a good trick to know and have in the book.
Questions in comments
Tags: CSS, CSS Images, CSS Tricks, XHTML/CSS
Categories: XHTML/CSS
Posted By: Dinulescu Alexandru Adrian
Last Edit: 01 Mar 2010 @ 02:11 PM
Recent Comments