views:

35

answers:

1

Hello,

I have a transparent table with width:100% which contains some html content. I use the table in order to position a content element on the screen center.

The table captures mouse events, and the user can't press on links which are positioned beneath it (although it is transparent).

Is there a way to tell the browser to ignore events on the table? I want to capture events only from the content inside the table (and from the rest of the site).

Thanks Yaron

+1  A: 

Using an HTML <table> is the wrong way to position an element in the center of the screen. Use proper CSS positioning.

For positioning text use: text-align: center;. For positioning block elements use:

margin-left: auto;
margin-right: auto;

That is not only the correct way to do things (CSS2 standard supported in all modern browsers), it will also solve your issue of captured events.

Yuval A
To be fair, *vertical* centering with nothing but CSS is a real pain.
Pointy
@Pointy - not to say that it's not difficult, but it is very much possible.
Yuval A