473,770 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Centering Thumbnail Galleries with CSS: Floats, Inline, Lists, ???

Hi -- I'm trying to figure out how to make a photo thumbnail gallery
page using CSS and no tables that (1) has a caption below each image
and (2) is centered -- so that as browser width changes the images
consistently reconstitute themselves as centered rows with the maximum
number of images on each row.

I've made a test page at http://www.americanstate.org/test/gal01/ that
illustrates what I'm aiming for and how close I've gotten. I've found
two nearly successful strategies: Use the float property (you can use
captions, but everything's edge-aligned, not center-aligned) or use
CSS-tweaked lists (you can center-align, but you can't have captions).

I actually succeeded in producing a CSS-defined thumbnail gallery page
with centered, captioned images, using the display:inline property --
but it only works in Internet Explorer 5.0 for Windows. That suggests
that what I'm aiming for is possible . . . but I want it to work in
standards-compliant browsers, too.

Would folks go take a look at my test page and see if they can solve
the problem? Thanks! I'll write up any success there and keep it in
circulation.
Jul 20 '05
14 3423
brucie schrieb:
in post: <news:d8******* *************** ****@posting.go ogle.com>
un*******@yahoo .com (Filippo Giarratano) said:

Hi -- I'm trying to figure out how to make a photo thumbnail gallery
page using CSS and no tables that (1) has a caption below each image
and (2) is centered -- so that as browser width changes the images
consistentl y reconstitute themselves as centered rows with the maximum
number of images on each row.

why not do something creative instead of the same old boring row/column
thumb layouts?

e.g: http://balls.bruciesusenetshit.info/


Clap clap clap clap! Neat demonstration.

--
Nicolai Zwar

Jul 20 '05 #11
Lauri Raittila <la***@raittila .cjb.net> wrote in message news:<MP******* *************** **@news.cis.dfn .de>...
I have thought that long too. It's been possible since Opera 5+, in
Opera, and IE god knows how long, using the bug.
.. . .
Quick and dirty hack:
http://www.student.oulu.fi/~laurirai/www/css/gallery/

This will look OK in WinIE5.5 and Opera 7.5.

It will use float:left for mozilla.

Tested with Opera 7.5p1, IE5.5, Firebird 0.7. Please tell if you test on
other browers. I hope it doesn't break anything.


Lauri: It centers in my Opera 7.11 and IE 5.0 and floats left in
Mozilla 1.6 (all Windows), just as you intended. Good job!

Do we agree that this is the best that can be achieved until more
browsers support "inline-block"?
Jul 20 '05 #12
In article Filippo Giarratano wrote:
Lauri Raittila <la***@raittila .cjb.net> wrote:
I have thought that long too. It's been possible since Opera 5+, in
Opera, and IE god knows how long, using the bug.
. . .
Quick and dirty hack:
http://www.student.oulu.fi/~laurirai/www/css/gallery/

This will look OK in WinIE5.5 and Opera 7.5.

It will use float:left for mozilla.


Seem to have strange effect on Opera 6, sometimes last line is not
wrapped.
Lauri: It centers in my Opera 7.11 and IE 5.0 and floats left in
Mozilla 1.6 (all Windows), just as you intended. Good job!

Do we agree that this is the best that can be achieved until more
browsers support "inline-block"?


I don't untill it is tested on KHTML and MacIE.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #13
Lauri Raittila wrote:
In article Filippo Giarratano wrote:
Lauri Raittila <la***@raittila .cjb.net> wrote:
> I have thought that long too. It's been possible since Opera 5+, in
> Opera, and IE god knows how long, using the bug.


. . .
> Quick and dirty hack:
> http://www.student.oulu.fi/~laurirai/www/css/gallery/
>
> This will look OK in WinIE5.5 and Opera 7.5.
>
> It will use float:left for mozilla.


Seem to have strange effect on Opera 6, sometimes last line is not
wrapped.
Lauri: It centers in my Opera 7.11 and IE 5.0 and floats left in
Mozilla 1.6 (all Windows), just as you intended. Good job!

Do we agree that this is the best that can be achieved until more
browsers support "inline-block"?


I don't untill it is tested on KHTML and MacIE.


Konqueror 3.1.4: the individual images are centred, but the whole table
isn't (it's on the left). Opera 7.23 (linux) has the images and the table
centred. In both cases, there's a gap between the image and the caption,
but not between the caption and the image below - this should be the other
way around, yes?

<http://hex.zapto.org/temp/2004/feb/konqueror.jpg>
<http://hex.zapto.org/temp/2004/feb/opera.jpg>

--
Matt

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #14
In article Matt wrote:
Lauri Raittila wrote:
In article Filippo Giarratano wrote:
Lauri Raittila <la***@raittila .cjb.net> wrote:

> I have thought that long too. It's been possible since Opera 5+, in
> Opera, and IE god knows how long, using the bug.

. . .

> Quick and dirty hack:
> http://www.student.oulu.fi/~laurirai/www/css/gallery/
Konqueror 3.1.4: the individual images are centred, but the whole table
isn't (it's on the left).
There is no table.
Opera 7.23 (linux) has the images and the table
centred. In both cases, there's a gap between the image and the caption,
but not between the caption and the image below - this should be the other
way around, yes?
The styling is very minimal, to not confuse browsers before testing
concept. (as you can see it's not real case, links aren't real.)
<http://hex.zapto.org/temp/2004/feb/konqueror.jpg>
Seems to act like Mozilla. Thanks.
<http://hex.zapto.org/temp/2004/feb/opera.jpg>


Same as on win. Maybe I remember to test with MacIE tomorrow. (speeded
past computer room with macs today, but didn't remember to pop in)

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #15

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

Similar topics

6
1947
by: Franois de Dardel | last post by:
http://mapage.noos.fr/dardelf3/tintin/page3bits.html Can I center the series of thumbnails horizontally in the pages _and_ keep the "elastic arrangement" where the number of thumbnails adapts to the width of the screen. François de Dardel http:/mapage.noos.fr/dardelf Faber est suae quisque fortunae Remove fourteen to reply
10
3142
by: Saravanan Raju | last post by:
I am trying to vertically align the CSS tabs so that it is centered, like what it appears on apple.com. You can find my web-page here (http://cse.unl.edu/~sraju/index-tabs.htm). It is now aligned to its left. Any input is appreciated! Peace, Saravanan
6
3151
by: Abs | last post by:
Hi! I'm trying to center horizontally the thumbnails at the top of the following page: http://project.fotografist.com/photos.php?p_idgal=1 Like the image at the center. I've tried different CSS things on different elements but I can't get it to work as I want. Any
5
2385
by: david hepworth | last post by:
I am in the process of creating a CSS tab style thing for my webpage. I have everything as i wish except that i cannot center the damn thing in the page. I am hoping someone out there can help. I am sure that it is a silly mistake but i have been staring at it for so long i am going stir-crazy! I have tried 'text-align: center;' in most parts of the CSS and in the div in the HTML but it does not like it. This is my CSS:...
3
4211
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a top level <divthen I can place it with CSS attribute 'left:', but this is a fixed offset. Is it possible to have a <divcentered in the browser window? 2. Verticle centering in <div>
8
20369
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1: Start with original thumbnails & two empty sub directories STEP 2: Create smaller versions of the originals for one sub directory STEP 3: Create thumbnail version of the originals the other sub directory STEP 4: Create an index.html pointing to the...
5
4825
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up doing this demo with tables. The main problems are the vertical centering of the info area, and of the text inside the squares.
4
3011
by: lister | last post by:
I am trying to center a DIV horizonally, but I want the DIV fluid so that it is just wide enough to encompass its contents. I've tried margin:auto with no joy :( I've set up a demo here: http://www.thebunnyshed.co.uk/centertest.htm ps. google screwed up my first post somehow.
13
2859
by: Casimir Pohjanraito | last post by:
I have a list of links, with a thumbnail image hidden(resized) next to the link. Complete html&css at end of this post. CSS for the link resizes the image on a:hover. All is good, except the list resizes to accomodate the image, thus "tearing up" the list. In some browsers the thumbnail and resize effect goes back and forth real fast (try mouseovering the "another page" link). I tried constraining the list item height, but that doesnt...
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.