aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Can't get CSS Positioning right 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 "Can Watch "Can New topic
Author

Can't get CSS Positioning right

Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Hello,

I can't seem to get CSS positioning worked out. Following is an html example of what I'm trying to do. All the divs except for #insideTop are shown more or less like I want, but #insideTop's "left" and "right" properties with both relative and absolute positioning are being ignored by both IE6 and Firefox. Could someone let me know what I am doing wrong?



Thank you in advance,
Yuriy
[ April 07, 2005: Message edited by: Yuriy Zilbergleyt ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Just a very very very quick glance. You need a doctype...make IE behave correctly.

Eric
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Thanks for the advice!

Just tried the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Seemed like the shapes of the div slightly changed in IE, probably the padding and stuff like that, but the main problem remains.

Thank you,
Yuriy
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
another thing looking at it, you have a : instead of a ; in the insideTop
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Also when you move stuff realtivly the holder does not change its height to fit it.....aka, you are going to get over hang....
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Yes, I realized that after looking at the borders. That's not really a big deal right now since bottomDiv isn't offset that much and insideTop will have a smaller width (I just didn't set it yet.) I'm just trying to figure out how to get insideTop positioned correctly within topDiv.

Thank you,
Yuriy
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
oops, putting the semicolon after "absolute" fixed the problem! Weird though since my actual page that this is based on didn't have the typo, and the problem is there. I'll have to take a closer look at the differences...

Thank you,
Yuriy
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I have a basic framework what you are working on...



To keep the formatting, quote this and then do a find/replace on the escaped tags. Makes it easier. This code is the basic frameowrk of my web page that I am working on, someday I might finsih it..

Eric
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
It's not quite what I need at the moment, but I'll use it for pages that fit. Thanks!
Oh and I worked out what was wrong with my page - a different typo.... Maybe I should use one of those CSS validators...

-Yuriy
 
Consider Paul's rocket mass heater.
 
subject: Can't get CSS Positioning right