Webmaster Forum

Go Back   Webmaster Forum > Web Development > Web Design Lobby

Web Design Lobby Forum for general web design issues not specific to scripting or graphics.


Reply
 
LinkBack Thread Tools Display Modes
Old 08-10-2006, 10:00 AM   #1 (permalink)
Junior Member
 
Join Date: 08-08-06
Posts: 8
iTrader: 0 / 0%
Latest Blog:
None

Jordonias is liked by many
Image inside Div

Ok, I have an image inside a div. The div is 804px by 100px. The image is 500px by 70px. I am trying to get it so that the image is aligned in the center of the div and on the complete bottom of it. Can anybody help me with this? How would I go about doing this?
Jordonias is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2006, 12:23 PM   #2 (permalink)
Senior Member
 
gaz545's Avatar
 
Join Date: 05-01-06
Posts: 133
iTrader: 0 / 0%
Latest Blog:
None

gaz545 is on the right pathgaz545 is on the right pathgaz545 is on the right path
Code:
img { left: 50%; top: 50%; }
Note that it will apple to every image.
gaz545 is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2006, 12:41 PM   #3 (permalink)
Junior Member
 
Join Date: 08-09-06
Location: Lafayette, LA
Posts: 9
iTrader: 0 / 0%
Latest Blog:
None

aaron lozier is liked by many
img inside div

Here is how I would do it.

Suppose your HTML looked like this:

<div id="myDiv">
<img src="myImg.jpg />
</div>

Your CSS should look like this: (remove style tags if using stylesheet)

<style>
#myDiv
{
width: 804px;
height: 100px;
position: relative;
}

#myDiv img {
width: 500px;
height: 70px;
position: absolute;
bottom: 0px;
left: 152px;
}
</style>

By placing the "position: relative" definition in your div, the div becomes the reference point for child elements, such as your image. You may then "absolutely position" the image, 0 pixels from the bottom, and 152 pixels from the left.

Let me know if this helps.
aaron lozier is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2006, 12:28 PM   #4 (permalink)
Empress™
 
chicgeek's Avatar
 
Join Date: 08-19-04
Location: Canadian in the UK
Posts: 14,213
iTrader: 0 / 0%
chicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest order
change that to

bottom: 0%
__________________
laura / chicgeek
soprano & web designer
@chicgeek on Twitter
laurakishimoto.ca
chicgeek is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2006, 12:30 PM   #5 (permalink)
Senior Member
 
gaz545's Avatar
 
Join Date: 05-01-06
Posts: 133
iTrader: 0 / 0%
Latest Blog:
None

gaz545 is on the right pathgaz545 is on the right pathgaz545 is on the right path
oh my bad, didn't read it correctly.
gaz545 is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2006, 12:44 PM   #6 (permalink)
Senior Member
 
JuggoPop's Avatar
 
Join Date: 10-09-03
Posts: 4,284
iTrader: 0 / 0%
Latest Blog:
None

JuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest orderJuggoPop is a web professional of the highest order
that's what i was thinking... good job there.
JuggoPop is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby

Reply


Currently Active Users Viewing This Thread: 3 (0 members and 3 guests)
 
Thread Tools
Display Modes

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
'Unable to save image' error for sig image danparks V7N Forum Support 20 02-22-2008 04:13 PM
Position image inside a CSS box? jolene Coding Forum 1 07-01-2004 11:22 AM
Can a 'swap image' graphic contain image mapping? lizbeth Coding Forum 2 04-22-2004 03:32 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 08:57 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.