Why's my image stuck in place.

This is a discussion on "Why's my image stuck in place." within the Web Page Design section. This forum, and the thread "Why's my image stuck in place. are both part of the Design Your Website category.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Feb 13th, 2007, 02:39
Junior Member
Join Date: Sep 2006
Location: Here
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Why's my image stuck in place.

So I'm using divs to layout a page and position some images. I'm realy getting the hang of CSS. But I've got a problem. One of my images is unresponsive to adjustment of it location on the page.
HTML: Select all
<div id="working-pic"><img class="working-pic" src="...working-pic.gif"></div>
<div id="broken-pic"><img class="broken-pic" src="...broken-pic.jpg"></div>
Code: Select all
#working-pic
{
    position: relative;
    left: 0em;
    top: -5em;
    width: 50em;
    height: 2em;
    color: #000000;
    font-size: 1em;
}
img.working-pic
{
    width: 50em;
    height: 2em;
}

#broken-pic
{
    position: relative;
    left: 10em;
    top: 50em;
    width: 30em;
    height: 50em;
}
img.broken-pic
{
    width: 30em;
    height: 50em;
}
What do you think?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Feb 16th, 2007, 09:42
drd drd is offline
Up'n'Coming Member
Join Date: Dec 2005
Location: Hampshire, England, UK
Age: 28
Posts: 65
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Why's my image stuck in place.

Have you tried position: absolute instead of relative?
note the container will need to be position:relative otherwise the screen will be used as the reference for your top and left values.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Feb 16th, 2007, 09:51
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Why's my image stuck in place.

Try using margin instead of positioning.

Code: Select all
#working-pic
{
    margin: -5em 0 0 0;
    width: 50em;
    height: 2em;
    color: #000;
    font-size: 1em;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Feb 18th, 2007, 18:26
Junior Member
Join Date: Sep 2006
Location: Here
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Why's my image stuck in place.

After some re-coding, I figured out what was wrong. My div ID began with a number. Firefox dosen't like that. I might not have figured it out had I not made this post and changed the filenames.

Thanks guys!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
css, div, positioning

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
Really stuck Paul00000001 Classic ASP 0 Sep 12th, 2006 08:50
How to make a tranparent image and position it in a particular place srinu_bits Web Page Design 6 Jun 2nd, 2006 15:07
Stuck... JRX.Will JavaScript Forum 0 Jan 18th, 2006 08:07
Where to place <background image> kaz Web Page Design 1 Dec 16th, 2005 00:49
Really Stuck Someone PHP Forum 6 Sep 17th, 2005 16:47


All times are GMT. The time now is 16:28.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization 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