CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 6th, 2001, 08:39 AM
nimr0d nimr0d is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Netherlands
Posts: 7 nimr0d User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question CSS: 2 overlapping background images

I have 2 images, a background pattern and a logo.

I want the background pattern to repeat over the whole page and the logo to be centered over the background.

I don't know if this is possible though.

Thx for any help :)

Reply With Quote
  #2  
Old June 8th, 2001, 02:06 AM
bombel bombel is offline
,-)
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Germany
Posts: 13 bombel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ain't possible with bg-images.

you could make the pattern with the background-tag and center the other image with an absolute positioned layer in the center of the screen (z-index:1).
put the content in another layer (z-index:2).

bombel

Reply With Quote
  #3  
Old June 8th, 2001, 07:26 AM
nimr0d nimr0d is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Netherlands
Posts: 7 nimr0d User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

Can you give me an example of how to do this?
(I never used z-layers before)

thx, nimr0d

Reply With Quote
  #4  
Old June 8th, 2001, 08:11 AM
oach oach is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: knee deep in sh*t
Posts: 251 oach User rank is Second Lieutenant (5000 - 10000 Reputation Level)oach User rank is Second Lieutenant (5000 - 10000 Reputation Level)oach User rank is Second Lieutenant (5000 - 10000 Reputation Level)oach User rank is Second Lieutenant (5000 - 10000 Reputation Level)oach User rank is Second Lieutenant (5000 - 10000 Reputation Level)oach User rank is Second Lieutenant (5000 - 10000 Reputation Level)oach User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 17 h 36 m 48 sec
Reputation Power: 64
Send a message via AIM to oach Send a message via MSN to oach Send a message via Yahoo to oach
Nimrod,

I am going to do my best to explain this to you. If you still have trouble, e-mail me at sschling@kaneland.org.

If you have taken a math class that deals with "3-space", which is actually how dimensions the real world we live in is made of, the teacher should of talked about the x and y axis but with a twist: the z axis thrown in. This allowed you to get depth and 3-dimensional objects. i.e. cones, cylinders, spheres, etc.

Enough with the math lesson (I am an old math teacher )!

When you use the z-index attribute within a css, the image is placed a distance from your starting canvas. Sounds confusing, let me use an example.

If you have two objects, trying to keep with your question, two images. If I start with a cork board and I want to tack the images to the board, but the board is too small, they will have to overlap. The image that is "in front" of the other is said to have a greater z-index, since it is further off the cork board.
The image on the cork board would have a z-index of 4, while the image in front of it would have a z-index greater than 4, so 5 would work. So would 6, 10, 100, just as long as it is greater than the z-index of the bottom picture.

Try this little code in a document and you can see what happens:
<html>
<head>
<title>Testing the z-index in Style Sheets</title>
<style type=text/css>
<!--
h2 { color=#ff0000; position: relative; left: 5px; top: 0px; z-index: 1}
h1 {color=#00ff00; position: relative; left: 20px; top: -40px; z-index: -2 }
-->
</style>
</head>
<body>
<h2>This should be on top</h2>
<h1>This should be behind the header of size 2</h1>
</body>
</html>

I hope this helps!

Reply With Quote
  #5  
Old June 12th, 2001, 06:31 AM
nimr0d nimr0d is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Netherlands
Posts: 7 nimr0d User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

Thanx, it almost works now. Only have to figure out how to center the img. 50% relative or absolute places it to the rigtht.

nimr0d

Reply With Quote
  #6  
Old June 12th, 2001, 07:18 AM
bombel bombel is offline
,-)
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Location: Germany
Posts: 13 bombel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
the only way to center the image is to get the screen-width (height) with a java-function and pass the value to the style-attribute of the layer.
i.e.
layer width=200px
screen-width=800px
left (in css-style for layer)=(screenwidth-layerwidth/2)

same with height.

You should find scripts on this issue everywhere.
percentages in layer-positioning don't work as far as I know.

bombel

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS: 2 overlapping background images

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap