Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / July 2008



Tip: Looking for answers? Try searching our database.

How to center 1 to n floating div boxes on a page?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bay - 30 Jun 2008 13:25 GMT
I’m trying to create a page, so that if one has a widescreen monitor,
they will be able to see as many centered divs on a row as possible.
So I’m floating these div boxes left so they are not stacking
vertically, but horizontally. The problem is, they don’t center. Do
you know a way do to it with CSS.

Thanks
dorayme - 30 Jun 2008 14:04 GMT
In article
<3a9bb275-e071-4e17-afaf-99159c2cebae@y38g2000hsy.googlegroups.com>,

> I¹m trying to create a page, so that if one has a widescreen monitor,
> they will be able to see as many centered divs on a row as possible.
> So I¹m floating these div boxes left so they are not stacking
> vertically, but horizontally. The problem is, they don¹t center. Do
> you know a way do to it with CSS.

No, you can't perfect centre with css as I understand you want. You can
get awfully close but.

But there is a way with some extra:

<http://tinyurl.com/2jcs5r>

Signature

dorayme

bay - 01 Jul 2008 14:56 GMT
Cool, it worked, but I had to fix the Javascript for it to work in IE
for some reason. Worked in FF fine.

> No, you can't perfect centre with css as I understand you want. You can
> get awfully close but.
[quoted text clipped - 5 lines]
> --
> dorayme
dorayme - 02 Jul 2008 00:07 GMT
In article
<db4c1dd2-ef59-4900-ba33-208c373712ac@m73g2000hsh.googlegroups.com>,

> Cool, it worked, but I had to fix the Javascript for it to work in IE
> for some reason. Worked in FF fine.
[quoted text clipped - 5 lines]
> >
> > <http://tinyurl.com/2jcs5r>

Feel free to give a URL so that your js could be traced by us all, it
might prove useful. I have clean forgot now if the mass of floats as a
whole centred properly in Internet Explorer, I think I would have
checked in IE6 at the time, but likely not in IE7? The javascript on
those pages at my URL is named in honour of its maker. And it was
fashioned probably with the details of my page in mind. So anything you
come up with that makes it more general would likely be helpful.

Signature

dorayme

BootNic - 02 Jul 2008 06:21 GMT
<doraymeRidThis-948361.09074302072008@news-vip.optusnet.com.au>

> In article
> <db4c1dd2-ef59-4900-ba33-208c373712ac@m73g2000hsh.googlegroups.com>,
[quoted text clipped - 17 lines]
> fashioned probably with the details of my page in mind. So anything
> you come up with that makes it more general would likely be helpful.  

CSS version. I did not even try to make this work with older mozilla
type browsers. Not really the same but close, and no js.

[url] http://tinyurl.com/637o7j [/url]

Signature

BootNic                                        Wed Jul 2, 2008 01:21 am
 "I suppose they are vicious rascals, but it scarcely matters what they
 are. I'm after what they know."
 *Gibson-Sterling, The Difference Engine*

dorayme - 02 Jul 2008 06:58 GMT
> <doraymeRidThis-948361.09074302072008@news-vip.optusnet.com.au>
>
[quoted text clipped - 24 lines]
>
> [url] http://tinyurl.com/637o7j [/url]

This is interesting. Nice in my Safari 2 but there is no wrapping at all
in FF 2.

Signature

dorayme

BootNic - 02 Jul 2008 17:00 GMT
<doraymeRidThis-F64B4F.15580202072008@news-vip.optusnet.com.au>

[snip]

>> CSS version. I did not even try to make this work with older mozilla
>> type browsers. Not really the same but close, and no js.
[quoted text clipped - 3 lines]
> This is interesting. Nice in my Safari 2 but there is no wrapping at
> all  in FF 2.

FF2 does not support inline-block, though FF3 does. It would also fail
in most other mozilla browsers.

What I have confirmed it works in:

IE 6
IE 7
Safari 3
FF 3
Opera 9.5
Galeon 2.0.5

Signature

BootNic                                        Wed Jul 2, 2008 12:00 pm
 Happiness for the average person may be said to flow largely from
 common sense - adapting one-self to circumstances - and a sense of
 humor.
 *Beatrice Lillie (1898-1989) English comedienne*

dorayme - 03 Jul 2008 02:22 GMT
> <doraymeRidThis-F64B4F.15580202072008@news-vip.optusnet.com.au>
>
[quoted text clipped - 19 lines]
> Opera 9.5
> Galeon 2.0.5

Right, well that covers a lot of users.

(But, aside from this exercise, for a feature that is not essential,
namely centering a mass of floated thumbs, I am still happier with the
the original, employing some js and not inconveniencing anyone at all).

Signature

dorayme

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.