PDA

View Full Version : float:right/text-align/width problems


jamessan
08-06-2003, 10:02 AM
I'm attempting to redesign my website(http://zero-entropy.net/zero2.php) using XHTML and CSS instead of the old HTML and tables. Everything's going alright so far except for a couple of things.

1) For the one table that I have kept so far, I can't get it to be aligned to the right in Mozilla.
2) I'm using float:right on my navbar and it is hanging out of the containing div in Mozilla.
3) The individual boxes of the navbar are supposed to be a fixed width, but in Mozilla they are only as wide as the text inside.

The reason I specify Mozilla is because it works fine in IE, which leads me to think that I'm doing something wrong. Any help would be appreciated

jamessan
08-06-2003, 10:28 AM
I took care of #2 and #3. Still stumped on #1, though.

jamessan
08-06-2003, 10:43 AM
Well, I figured everything out. For those wondering what it looked like before, here's (http://www.ccs.neu.edu/home/jamessan/foo.jpg) a screenshot. Here's how I fixed everything.

1) margin-right:0px; margin-left:auto;
2) Put the navbar in a containing div with float:right; position:relative; bottom:1.25em; right:25.5em;
Then, I enclosed each inner box in a div and absolutely positioned those within the navbar div.
3) Enclosing the individual boxes in a div instead of a span fixed this. Goes to show ya the difference that a block element (div) vs. a non-block element (span) makes.

EscapeCharacter
08-06-2003, 09:16 PM
thanks for posting the answer im gonna be messing with more css on my site and probably gonna run into the same problems