English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Is it possible?

Example:
This centers:






This doesn't





But I need the purple box to be absolute so I can define other elements within it relative to it's position.

2007-03-28 08:07:48 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

*lol* Thanks Rex.

I am so sick of css not being implimented properly.

I am having problems on the other webpage I did with scrollbars. IE places them within the div where they should be properly no matter what. But Netscape and firefox in windows place nudge them outside of the div if I try to use padding/margins, etc to make a space around the text.

And on the newest version of Firefox for the mac sometimes for no reason allows the text to go under the scroll bar -real helpful because I am sure that is a feature everyone wants: unreadable text!

I am begining to wonder why all the fuss about divs and what was wrong with tables.

2007-03-28 09:54:58 · update #1

3 answers

Hello again Mystic, hope everything is going well.

That is an extremely difficult problem due to the way most browsers (like IE and Firefox) implement the CSS standard for block element margins. Ultimately, the easiest solution is probably to figure out a different way to lay out your elements in code to achieve the same visual style.

There is a kind of hack that works on most platforms, but a side effect is that it breaks the inner box out of the flow of the outer box; in order for the outer box to stretch to the max allowable width, instead of a static specified width, it cannot automatically wrap around the height of the inner DIV:





inner absolute element





On my website, I ended up using a small table for the main navigation because the current implementations of the CSS standard simple cannot display the effect I need.

2007-03-28 08:52:25 · answer #1 · answered by Rex M 6 · 0 0

i will say in fact, it is centered. by placing an absolute positioned item in the center, it will center the inner div's "position". that means the top left corner of that div will be centered. if you add a left positioning to the style at (negative) half the width of the box, you should achieve what you are trying to do. try something like:







disclaimer: this is a bit of a hack. text and other object placement may be difficult.

2007-03-28 15:49:16 · answer #2 · answered by javier 2 · 0 1

I have a Corgi too !!!!

2007-03-28 15:10:47 · answer #3 · answered by jrivera_e17 2 · 0 2

fedest.com, questions and answers