472,954 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

floating in centered elements

The buy behind the csszengarden has a tutorial on how to center
absolutely positioned elements. Here's the last example:

http://www.mezzoblue.com/tests/centered-css/ex5.html

I've tried replacing the text with three divs of different colors
floated next to one another to no avail:

http://www.frostjedi.com/terra/dev/test.html

As can be seen, the vanilla colored box is duplicated (atleast in IE;
in firefox, it appears as a line). Also, when the content inside the
div that produces the vanilla colored box is floated left, the fact
that margin-left/right are set to auto seems to be ignored.

So any ideas as to how I can float content within divs that are both
centered and absolutely positioned?

Jul 21 '05 #1
4 1705
in comp.infosystems.www.authoring.stylesheets, yawnmoth wrote:
The buy behind the csszengarden has a tutorial on how to center
absolutely positioned elements. Here's the last example:

http://www.mezzoblue.com/tests/centered-css/ex5.html
Doesn't seem to work on Opera 8, don't know why.
I've tried replacing the text with three divs of different colors
floated next to one another to no avail:

http://www.frostjedi.com/terra/dev/test.html

As can be seen, the vanilla colored box is duplicated (atleast in IE;
in firefox, it appears as a line).
Unfortunately I have no idea what you mean with vanilla color, but I
don't see anything.
Also, when the content inside the
div that produces the vanilla colored box is floated left, the fact
that margin-left/right are set to auto seems to be ignored.

So any ideas as to how I can float content within divs that are both
centered and absolutely positioned?


Set positioned element (min-)width and (min-)height equal to float size.
Set it to display:table. Don't use float when you don't need it.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Jul 21 '05 #2

Lauri Raittila wrote:
in comp.infosystems.www.authoring.stylesheets, yawnmoth wrote:
<snip>
As can be seen, the vanilla colored box is duplicated (atleast in IE; in firefox, it appears as a line).
Unfortunately I have no idea what you mean with vanilla color, but I
don't see anything.


in opera, it appeared as a black line, but regardless, that problem has
been fixed.
Also, when the content inside the
div that produces the vanilla colored box is floated left, the fact
that margin-left/right are set to auto seems to be ignored.

So any ideas as to how I can float content within divs that are both centered and absolutely positioned?


Set positioned element (min-)width and (min-)height equal to float

size. Set it to display:table. Don't use float when you don't need it.


tried that, and it didn't work :(:

http://www.frostjedi.com/terra/dev/test2.html

although that said, i don't think the problem relates to floats,
anymore, so much as it does the fact that i'm simply using divs within
another div that's been both centered and absolutely positioned.

Jul 21 '05 #3
in comp.infosystems.www.authoring.stylesheets, yawnmoth wrote:
tried that, and it didn't work :(:

http://www.frostjedi.com/terra/dev/test2.html

although that said, i don't think the problem relates to floats,
anymore, so much as it does the fact that i'm simply using divs within
another div that's been both centered and absolutely positioned.


Maybe, if you would describe what you wanted to see? It would be easier
to answer.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Jul 21 '05 #4
Lauri Raittila wrote:
in comp.infosystems.www.authoring.stylesheets, yawnmoth wrote:
tried that, and it didn't work :(:

http://www.frostjedi.com/terra/dev/test2.html

although that said, i don't think the problem relates to floats,
anymore, so much as it does the fact that i'm simply using divs within another div that's been both centered and absolutely positioned.
Maybe, if you would describe what you wanted to see? It would be

easier to answer.


i photoshopped an example of what i'd like:

http://www.frostjedi.com/terra/dev/test.jpg

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: DaWoE | last post by:
Hi, I want to place a div centered of another div in IE. I get this to work in Mozilla, but not in IE. The code i use for mozilla is the following : <html> <head> <style type="text/css">
8
by: Freek te Water | last post by:
Hi, Hope no-one is offended by my probably noob question... Context: I have a web page design, which always centres in the middle of the screen (using a 100%*100% HTML-table). Now I also use...
4
by: Mimo Zus | last post by:
I'm hoping that someone can explain what's going on; better yet provide a workaround. I'm designing a centered CSS site based on a 550 pixel wide vertical background image. Onto this background...
6
by: =?iso-8859-1?B?QW5kcukgSORuc2Vs?= | last post by:
Hi, I'm trying to make a centered box with an image and two links inside, one link on each side. Here is an image of what I want: http://kundenweb.creations.de/usenet/katzen/box.jpg I'm...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.