Jump to content

z-index


girl

Recommended Posts

that doesn't like any valid syntax for CSS or JS, so it's really hard to know at all what you're doing without any sort of provided context.

  • Like 1
Link to comment
Share on other sites

Compare to what??? When I insert image without z-index. it looks normal, whne i add Z-index... becomes not so bright, shadowy. Code is very simple: in html file<img src="images/homapage.jpg" class="homeimage"> in css file .homeimage {width:920; height:420; position:absolute; top:10px; border-radius:30px; -moz-border-radius:30px;-webkit-border-radius:30px; z-index:-1;}

Link to comment
Share on other sites

What browser are you using? Does the same problem occur if you use a positive number or 0 for the z-index? I've heard that some browsers have issues with negative values. I'm not sure what sort of issues, but maybe this is one of them.

  • Like 1
Link to comment
Share on other sites

Then I'm guessing the problem is because your browser doesn't properly support negative values. You can just set the z-index of the image to 0 and set the z-index of the text to something higher.

Edited by ShadowMage
  • Like 1
Link to comment
Share on other sites

A negative z-index is legal and allowed, and I don't think any browser since Netscape 4 has a problem with a negative z-index. The problem with using them is that you need to apply a z-index to every other element. If an element does not have a z-index defined then it is assumed to be 0, which means a negative z-index goes behind every element that has no z-index defined, possibly including the body itself. It sounds like you have some semi-transparent layer near the bottom of the stack that has no z-index defined and it's getting displayed over the image. "Not so bright, shadowy" sounds like you have a semi-transparent layer showing a shadow near the bottom of the stack.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...