File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes HTML div tags - positioning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "HTML div tags - positioning" Watch "HTML div tags - positioning" New topic

HTML div tags - positioning

Vinnie Jenks
Ranch Hand

Joined: Apr 26, 2004
Posts: 207
I'm working w/ some drag & drop DHTML (ahem, sorry..."AJAX") :roll: - and I'm trying to figure out how to position <div> elements on my page. I've been coding web apps for years but have *always* avoided DHTML due to the inconsistencies across browsers but am trying to get up to speed.

I've got a div like so:

The problem is...this div is inside of a table cell (and has to remain this way, I need the tables)...and I need it to *stay* within the table cell...even though it is an absolute-positioned div. How can I make it stay inside of the table cell and move with the table when the browser is resized by the user?


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

absolute: relative;

Is this just a typo? It is not valid. Thes CSS rule is 'position'.

I'm not absolutely sure what you are trying to do (position the div inside the cell?), but you may have better luck using margins rather than positioning.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: HTML div tags - positioning
It's not a secret anymore!