Closed Thread Icon

Topic awaiting preservation: How to get Divs to actually contain? Pages that link to <a href="https://ozoneasylum.com/backlink?for=8104" title="Pages that link to Topic awaiting preservation: How to get Divs to actually contain?" rel="nofollow" >Topic awaiting preservation: How to get Divs to actually contain?\

 
Author Thread
Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 03-01-2002 17:07

I've been working on some new stuff. I'm determined to make it work in Mozilla but I've got a question. In IE I can define the properties of a div like this:

#myDiv { position:absolute; left:0px; top:0px; width: 0px; height: 0px; }

Then I place an image inside that div like this:

<div id="myDiv"><img src="blank.gif" id="MI" width="25" height="25" alt="" border="0"></div>

When the page loads the div is automatically sized to "contain" its contents. That is to say that I do not have to explicitly resize the div to the size of the image it contains because the div acts like a rubber band around the image.

In Mozilla, this does not happen. The div does *not* resize according to its contents and I was wondering if there is a way to make that happen? I could code it so that I resize the div and the image it contains but I would rather not if there is a property I'm missing.

Any help?

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 03-01-2002 17:57

Bugimus: I'd try something like setting width and height to auto.

Emps

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 03-01-2002 18:07

Hmmm..... I'm guessing some sort of upwards inheiritance but I can't find any method for this.





:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 03-01-2002 21:30

This has already been discussed at http://www.ozoneasylum.com/Forum4/HTML/000025.html

« BackwardsOnwards »

Show Forum Drop Down Menu