Placing an object on top of a picture

Placing an object on top of a picture

am 06.06.2007 10:34:40 von Harry Bellafonte

Hi

Which html tag can I use to place another object ( picture or text) on
top of another picture?
I know I can use div, but then I can only place the object in the
center, left or right. And I want to place the object at a certain
position on the picture.

Any help will be appreciated.

Regards

Re: Placing an object on top of a picture

am 06.06.2007 11:03:05 von Ben C

On 2007-06-06, Harry Bellafonte wrote:
> Hi
>
> Which html tag can I use to place another object ( picture or text) on
> top of another picture?
> I know I can use div, but then I can only place the object in the
> center, left or right. And I want to place the object at a certain
> position on the picture.
>
> Any help will be appreciated.

Use position: absolute. Something like this:



...



The outer div is made position: relative so it becomes the "containing
block" for the absolutely positioned one, i.e. the block from which
"top: 14px; left: 32px" is measured.

Re: Placing an object on top of a picture

am 06.06.2007 18:34:33 von cwdjrxyz

On Jun 6, 4:03 am, Ben C wrote:
> On 2007-06-06, Harry Bellafonte wrote:
>
> > Hi
>
> > Which html tag can I use to place another object ( picture or text) on
> > top of another picture?
> > I know I can use div, but then I can only place the object in the
> > center, left or right. And I want to place the object at a certain
> > position on the picture.
>
> > Any help will be appreciated.
>
> Use position: absolute. Something like this:
>
>


>
>
...

>

>
> The outer div is made position: relative so it becomes the "containing
> block" for the absolutely positioned one, i.e. the block from which
> "top: 14px; left: 32px" is measured.

Yes, this should work. If the composite image is one you wish to use
many times on web pages, it might be worth using an image tool to make
a new composite image from the two images so that you will only have
the insert the composite image in the future. But the absolute
positioning code is so short in this case tha creating a new composite
image would save only little extra code.

Re: Placing an object on top of a picture

am 06.06.2007 20:50:00 von Harry Bellafonte

On 6 jun, 11:03, Ben C wrote:
> On 2007-06-06, Harry Bellafonte wrote:
>
> > Hi
>
> > Which html tag can I use to place another object ( picture or text) on
> > top of another picture?
> > I know I can use div, but then I can only place the object in the
> > center, left or right. And I want to place the object at a certain
> > position on the picture.
>
> > Any help will be appreciated.
>
> Use position: absolute. Something like this:
>
>


>
>
...

>

>
> The outer div is made position: relative so it becomes the "containing
> block" for the absolutely positioned one, i.e. the block from which
> "top: 14px; left: 32px" is measured.

Hi

Thank you very much for the tip. It worked at one perfectly!!!!

Kind Regards