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 September 24th, 2008, 11:07 AM
CelticDaddio CelticDaddio is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 5 CelticDaddio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 59 sec
Reputation Power: 0
Is it possible to use CSS to place one image over the top of the other?

Is it possible to use CSS to place one image over the top of the other? For what I mean go here:

celticblues dot com/test/test.html

I could do the same thing via photoshop, but I want to do it with CSS as I have several to do and I am not sure of the relative sizes yet and don't want to keep redoing the photoshop thing.

Ed

Reply With Quote
  #2  
Old September 24th, 2008, 01:54 PM
groundscape's Avatar
groundscape groundscape is offline
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2001
Location: Right now? On my chair.
Posts: 1,795 groundscape User rank is Captain (20000 - 30000 Reputation Level)groundscape User rank is Captain (20000 - 30000 Reputation Level)groundscape User rank is Captain (20000 - 30000 Reputation Level)groundscape User rank is Captain (20000 - 30000 Reputation Level)groundscape User rank is Captain (20000 - 30000 Reputation Level)groundscape User rank is Captain (20000 - 30000 Reputation Level)groundscape User rank is Captain (20000 - 30000 Reputation Level)groundscape User rank is Captain (20000 - 30000 Reputation Level)groundscape User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 700 Folding Title: Novice Folder
Time spent in forums: 1 Week 4 Days 18 h 43 m 47 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 252
Give the small image a position:relative; a z-index:20; and then use the offset properties to move it on top of the image. The offset properties are
top:
bottom:
right:
left:

Cheers.
__________________
Use markup the semantic way. You wouldn't want your dog answering the phone for you, would you?
HTML Validator || CSS Validator -- HTML / CSS Main forums. JavaScript and PHP...maybe
Bones: HTML; Skin: CSS; Muscle: JavaScript; Brains: PHP; Memory: MySQL

Reply With Quote
  #3  
Old September 24th, 2008, 06:24 PM
Arem's Avatar
Arem Arem is offline
Classical Computing
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2008
Location: Melbourne, Australia
Posts: 893 Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 17 h 32 m 29 sec
Reputation Power: 101
Another option is to have one div inside another. Set the large photo as the background image of the container div, and the small photo either as a background image of the inner div or as a regular image in the html.
__________________
Simple is beautiful.

Reply With Quote
  #4  
Old September 25th, 2008, 03:32 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 3,009 Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level)Akh User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Days 17 h 35 m 11 sec
Reputation Power: 1223
You could also set the large image as background of the small.

Code:
css:
img {
	background:url(file1.jpg) center no-repeat;
	padding:145px 264px;
}

html:
<img src="file2.jpg" alt="fail" />


You need to make sure IE is in standard mode, or else it would fail.
http://quirksmode.org/css/quirksmode.html
__________________

Reply With Quote
  #5  
Old September 25th, 2008, 09:25 AM
Arem's Avatar
Arem Arem is offline
Classical Computing
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2008
Location: Melbourne, Australia
Posts: 893 Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level)Arem User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 17 h 32 m 29 sec
Reputation Power: 101
Quote:
Originally Posted by Akh
You could also set the large image as background of the small.

Hmm, good idea!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Is it possible to use CSS to place one image over the top of the other?

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