CSS z-index for image ???

This is a discussion on "CSS z-index for image ???" within the Web Page Design section. This forum, and the thread "CSS z-index for image ??? are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 6th, 2006, 13:07
Junior Member
Join Date: Apr 2006
Age: 27
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Question CSS z-index for image ???

I'm trying to add a gradient I made as a background to my "centerContent", so it acts as a shadow to the border of "centerContent".

I'm using CSS's z-index property to get the desired result, but am not having this "content-shadow" image displaying on my page, at all. There may be other way of achieving the same, but z-index seems little easy to understand, so I'll stick with z-index for now.

The related CSS is:

Code: Select all
.centerContentShadow
{
    background-image:url(content-shadow.jpg);
    background-repeat:repeat-y;
    width:800px;
    z-index:-1;
}

#centerContent
{
    background-image:url(contentbackground.jpg);
    width:700px; 
    margin-left:45px;
    float:left;
    border-left:1px solid #999999;
    border-right:1px solid #999999;
}
while my HTML is:

Code: Select all
<div class="centerContentShadow" id="centerContent">
My website in itself can be seen on (please refresh the page, if :

http://darsh25.silverserve.co.uk/All...gn/contact.php

While all the files can be seen on:

http://darsh25.silverserve.co.uk/AllInclusiveWebDesign/

My desired result can be seen at: http://www.tristarwebdesign.co.uk/

Am I not doing things in the way I should've been doing ???
Reply With Quote

  #2 (permalink)  
Old Jul 6th, 2006, 13:51
minute44's Avatar
Moderator
Join Date: Apr 2006
Location: Nottingham UK
Age: 25
Posts: 1,351
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: CSS z-index for image ???

This may sound stupid but try moving the properties for Content Shadow physically further down in the CSS text. It get's interpreted like a script kind of so the last thing to get read is the last thing rendered.

It might work. might not...
Last Blog Entry: Annoying people.... (Jan 16th, 2008)
Reply With Quote
  #3 (permalink)  
Old Jul 7th, 2007, 10:10
New Member
Join Date: Jul 2007
Location: Phc, Nigeria
Age: 30
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS z-index for image ???

Quote:
Originally Posted by j4mes_bond25 View Post
I'm trying to add a gradient I made as a background to my "centerContent", so it acts as a shadow to the border of "centerContent".

I'm using CSS's z-index property to get the desired result, but am not having this "content-shadow" image displaying on my page, at all. There may be other way of achieving the same, but z-index seems little easy to understand, so I'll stick with z-index for now.

The related CSS is:

Code: Select all
.centerContentShadow
{
    background-image:url(content-shadow.jpg);
    background-repeat:repeat-y;
    width:800px;
    z-index:-1;
}

#centerContent
{
    background-image:url(contentbackground.jpg);
    width:700px; 
    margin-left:45px;
    float:left;
    border-left:1px solid #999999;
    border-right:1px solid #999999;
}
while my HTML is:

Code: Select all
<div class="centerContentShadow" id="centerContent">
My website in itself can be seen on (please refresh the page, if :

http://darsh25.silverserve.co.uk/All...gn/contact.php

While all the files can be seen on:

http://darsh25.silverserve.co.uk/AllInclusiveWebDesign/

My desired result can be seen at: http://www.tristarwebdesign.co.uk/

Am I not doing things in the way I should've been doing ???
Hi, I'd been looking for a code that can help me put a shadow on my page. I found this post and decided to twik it a bit...just like this:
Code: Select all
<style type="text/css">
<!--
body {
background-image: url(images/bg_grd.gif);
background-repeat: no-repeat;
}
.centerContentShadow
{
    background-image: url(images/bg-trns.png);
    background-repeat:repeat-y;
    width:800px;
	margin-top: -20px;
    z-index:-1;
}
#centerContent
{
    background-image: url(images/bg-inner.gif);
    width:770px; 
    margin-left:12px;
	margin-right:12px;
   	border-left:1.2px solid #003366;
    border-right:1.2px solid #003366;
}

-->
</style>
....and then the
HTML: Select all
<body><center><div class="centerContentShadow"><div id="centerContent">
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  </div></div>
 </center>
</body>
...Don't mind the '<p>' tags. Was just trying to pull down the div to appreciate the effect. It's working well in Opera and Firefox but not IE. Can anyone show me what I need to do? You can check out the page here http://havilahandhills.com/test
Thanks,
Havilah
Reply With Quote
  #4 (permalink)  
Old Jul 7th, 2007, 11:49
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS z-index for image ???

I don't see a difference in FF2 and IE7. Can you tell me more?
Reply With Quote
  #5 (permalink)  
Old Jul 7th, 2007, 12:11
New Member
Join Date: Jul 2007
Location: Phc, Nigeria
Age: 30
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS z-index for image ???

Lchad, IE displays it with an additional white background underneath the transparent shadow. Othe browsers don't. That's the major difference. I want to know the version of IE that u r using?
Reply With Quote
  #6 (permalink)  
Old Jul 7th, 2007, 12:14
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS z-index for image ???

Ie7
Reply With Quote
  #7 (permalink)  
Old Jul 7th, 2007, 12:19
New Member
Join Date: Jul 2007
Location: Phc, Nigeria
Age: 30
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS z-index for image ???

ok, but have u noticed the difference?
Reply With Quote
  #8 (permalink)  
Old Jul 7th, 2007, 12:26
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS z-index for image ???

Your problem is with IE6. You are using a png image for that correct?
I do not believe png is supported by ie6. Change it to a gif and you should be fine.
Reply With Quote
  #9 (permalink)  
Old Jul 7th, 2007, 12:34
New Member
Join Date: Jul 2007
Location: Phc, Nigeria
Age: 30
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS z-index for image ???

gif won't let the background remain transparent.
Reply With Quote
  #10 (permalink)  
Old Jul 7th, 2007, 12:43
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: CSS z-index for image ???

Looks like you'll need some javascript to be able to make it work in IE 6
See this tutorialhttp://allinthehead.com/retro/289/sl...kgrounds-in-ie
Reply With Quote
Reply

Tags
css, zindex, image

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
z-index - dragging benreynolds4 JavaScript Forum 0 May 25th, 2008 14:54
google and index dab42pat Search Engine Optimization (SEO) 5 Aug 15th, 2007 13:59
google-index cyclone2876 Search Engine Optimization (SEO) 3 Jun 26th, 2007 14:24
TOC and Index bonekrusher Other Programming Languages 0 Jul 24th, 2006 23:03


All times are GMT. The time now is 00:50.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43