Reply to Re: Broken: absolutely positioned divs within a td in FF

Your name:

Reply:


Posted by Gιrard Talbot on 05/05/06 09:44

subp@wachtel.us wrote :
> Hi there,
> I've searched and can't find a solution.
>
> I have a relatively positioned td


The latest CSS 2.1 Working draft (in fact, all CSS 2.x technical
recommendation releases) strongly discourage the use of position on
table cells:

"The effect of 'position:relative' on (...) table-cell (...) elements is
undefined."
http://www.w3.org/TR/CSS21/visuren.html#propdef-position

"Note. Positioning and floating of table cells can cause them not to be
table cells anymore, according to the rules in section 9.7"
http://www.w3.org/TR/CSS21/tables.html#q7


and absolutely positioned DIVs within
> it.


Why make complex when you can do simple?


> In IE, it works, but in FF it doesn't.

Chances are: in IE, it's a layout bug but in FF it renders exactly what
your code demanded.


> Here's my example code:

How about an url instead?


> HTML file:
> <html><head><title>test</title><link rel="stylesheet" type="text/css"
> href="test_css_positioning.css" />

Is this XHTML or HTML? You use no doctype declaration.

</head>
> <body>
> <h1>Test of Absolute Positioning in Table Data</h1>
> All of the divs should show up in their proper places inside of the td.
> <table>
> <tr>
> <td id="container">center
> <div id="topleft">topleft</div>
> <div id="topright">topright</div>
> <div id="bottomleft">bottomleft</div>
> <div id="bottomright">bottomright</div>
> </td>
> </tr>
> </table>
> </body>
> </html>
>
> CSS file:
> td#container {
> position: relative;
> width: 500px;
> border: 1px #000000 solid;
> height: 70px;
> text-align: center;
> vertical-align: middle;}
>
> #topleft {
> position: absolute;
> top: 0px;
> left: 0px;
> }

So far, we can establish for sure that the whole table, table rows and
table cells were not needed at all if you wanted to position something.
If the table (and table row, table cells) were needed, then using css
properties responsible for horizontal alignment was ok.

GΓ©rard
--
remove blah to email me

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация