Cloning height

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
diggz
Forum Newbie
Posts: 2
Joined: Thu Mar 13, 2008 8:14 am

Cloning height

Post by diggz »

Hello,

I am having a problem resizing a few of my elements. I have an element that holds and image and and element that holds content. I would like the image the resize to the same size as the element that holds the content. Both elements are coded in CSS but i cannot figure out a way to get the image to resize the to the same size as the content area.

There is no way to put the content area and the image area into a single div tag as they are both loaded dynamically from a template. Is there anyway in the css to tell it to use the same height as the content area?

At the moment on the content area there is only a min-height tag and no tag from the actual height of the content box because it is dynamic and depends on the amount of content that is being displayed.

Thanks
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: Cloning height

Post by omniuni »

try giving the image "width: 100%; height: 100%;" and see what happens.

Good Luck!

-Omni
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Cloning height

Post by pickle »

If the width & height are set in CSS, then just setting the height should automatically resize the width accordingly (at least in modern browsers).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Cloning height

Post by JAB Creations »

It sounds like your content isn't clearing it's parent element. Try using the overflow property on the parent element. For ancient browser support throw a br element at the bottom, it's messy but works.
Post Reply