Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 75 Time: 09:35 - Jan 15, 2008  

sbjc23

Why is the "relative" attribute in a div tag making the whole cell adjust in size?

I am trying to have an larger preview image pop up over a smaller thumbnail when I scroll over it by having a hidden <div> be shown. Everything is working perfectly when I have the <div> show up from an absolute position BUT for some reason when I change the positioning to be relative the cell that the thumbnail is contained within is expanding as if the larger preview image within the <div> was actually being shown underneath it on the page.

<td height="" align="center" valign="top" width="" colspan="2">
<a href="services_inventory_sku_details_2.html" onmouseover="javascript:show_div()" onmouseout="javascript:hide_div()"><img src="sku_tshirt.gif" border="0"></a>
<div class="img-shadow" id="RegUser1" style="visibility:hidden; position:absolute; top:50px; left:190px;">
<img src="productPreview.jpg" alt="test"/>
</div>
</td>

Why is this happening when I am just switching where the positioning measurements should be starting from? I have tried a couple options with the display attribute but it doesn't work.

Categories

Answer Discussion
Tutorials

 

jgivoni

Date:: Jan 16, 2008

Time:: 08:31

The reason your container cell is expanding is that an element with visibility: hidden and position: relative should take up space in the flow as if it were really there. Such are the CSS specs.
Two ways to avoid the hidden div taking up any space:
position: absolute (which takes the element out of flow)
or
display: none (which prevents any rendering of the element)

If you want to change the positioning offset, you should put position: relative on one of the div's parent elements.

Hope this helps,
Jakob

admin

Date:: Mar 04, 2009

Time:: 10:05

The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.

The Quomon Team

admin

Date:: Mar 12, 2009

Time:: 14:35

The question has been closed.

The Quomon Team

Question Answered

This question has been closed, and points have been rewarded to the following experts:


jgivoni: 75

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es