HighDots Forums  

Relative CSS positioning

alt.html alt.html


Discuss Relative CSS positioning in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim Johansson
 
Posts: n/a

Default Relative CSS positioning - 08-02-2004 , 06:46 PM






Hello,

I have an image, upon which I want to place another image. I've figured out
this should be done by CSS positioning, but I don't know the exact
coordinates of the other image. How do I place the image knowing only where
on the other image I want to place it?
--
--
www.gurka.se/gurka.php?x=1&language=english
Tremble before the mighty Cucumber



Reply With Quote
  #2  
Old   
rf
 
Posts: n/a

Default Re: Relative CSS positioning - 08-02-2004 , 07:26 PM






Tim Johansson

Quote:
I have an image, upon which I want to place another image.
Why not use your image composing software?

--
Cheers
Richard.




Reply With Quote
  #3  
Old   
Spartanicus
 
Posts: n/a

Default Re: Relative CSS positioning - 08-02-2004 , 07:32 PM



"Tim Johansson" <spam (AT) gurka (DOT) se> wrote:

Quote:
I have an image, upon which I want to place another image. I've figured out
this should be done by CSS positioning
Try negative margins first.

--
Spartanicus


Reply With Quote
  #4  
Old   
Tim Johansson
 
Posts: n/a

Default Re: Relative CSS positioning - 08-03-2004 , 05:06 AM





"rf" <rf@.invalid> skrev i meddelandet
news:q4APc.29732$K53.24722 (AT) news-server (DOT) bigpond.net.au...
Quote:
Tim Johansson

I have an image, upon which I want to place another image.

Why not use your image composing software?

The image's position is calculated by PHP, and creating images on-the-fly
would consume too much time and bandwidth.
Quote:
--
Cheers
Richard.





Reply With Quote
  #5  
Old   
rf
 
Posts: n/a

Default Re: Relative CSS positioning - 08-03-2004 , 05:56 AM



Tim Johansson
Quote:
"rf" <rf@.invalid> skrev i meddelandet
news:q4APc.29732$K53.24722 (AT) news-server (DOT) bigpond.net.au...
Tim Johansson

I have an image, upon which I want to place another image.

Why not use your image composing software?

The image's position is calculated by PHP, and creating images on-the-fly
would consume too much time and bandwidth.
Hmmm. Off top of head solution #1...

Create a div exactly the same size as the first image. Background of div is
first image. Position: relative so it becomes a containing element (no top
or left).

Inside the div an <img> pointing to the second image. Position: absolute.
Top: and bottom: now refer to the top left of the div, that is the first
image. If the first image (the div really) moves then so does the second
image.

You don't need to know where the first image is positioned (which is a real
hard thing to determine anyway (client side) and usually impossible server
side).

<tinkers/>
http://users.bigpond.net.au/rf/images.html

Be sure to change your font size so you can see that when to roo moves so
does the bug.

--
Cheers
Richard.




Reply With Quote
  #6  
Old   
Sid Ismail
 
Posts: n/a

Default Re: Relative CSS positioning - 08-03-2004 , 07:24 AM



On Tue, 3 Aug 2004 00:46:36 +0200, "Tim Johansson" <spam (AT) gurka (DOT) se> wrote:

: I have an image, upon which I want to place another image. I've figured out
: this should be done by CSS positioning, but I don't know the exact
: coordinates of the other image. How do I place the image knowing only where
: on the other image I want to place it?

Use a graphics editor, surely? PSP or Irfanview.

Sid


Reply With Quote
  #7  
Old   
Tim Johansson
 
Posts: n/a

Default Re: Relative CSS positioning - 08-03-2004 , 07:38 AM



"rf" <rf@.invalid> skrev i meddelandet
news:AjJPc.30506$K53.18051 (AT) news-server (DOT) bigpond.net.au...
Quote:
Tim Johansson
"rf" <rf@.invalid> skrev i meddelandet
news:q4APc.29732$K53.24722 (AT) news-server (DOT) bigpond.net.au...
Tim Johansson

I have an image, upon which I want to place another image.

Why not use your image composing software?

The image's position is calculated by PHP, and creating images
on-the-fly
would consume too much time and bandwidth.

Hmmm. Off top of head solution #1...

Create a div exactly the same size as the first image. Background of div
is
first image. Position: relative so it becomes a containing element (no top
or left).

Inside the div an <img> pointing to the second image. Position: absolute.
Top: and bottom: now refer to the top left of the div, that is the first
image. If the first image (the div really) moves then so does the second
image.

You don't need to know where the first image is positioned (which is a
real
hard thing to determine anyway (client side) and usually impossible server
side).

tinkers/
http://users.bigpond.net.au/rf/images.html

Be sure to change your font size so you can see that when to roo moves so
does the bug.

--
Cheers
Richard.


It worked great, thanks!




Reply With Quote
  #8  
Old   
lime
 
Posts: n/a

Default Re: Relative CSS positioning - 08-03-2004 , 08:33 PM



Quote:
I have an image, upon which I want to place another image.


Hmmm. Off top of head solution #1...
<snip>

Unbelievable, off the top of your head hey? That's great...




Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.