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

Home Posts Topics Members FAQ

Centering an UL with images

Abs
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
suggestions, please?

Here there is the CSS file:

http://project.fotografist.com/styles/styles_black.css

Some styles are inlined in the HTML code, though.
Regards

--
Abs
Jul 20 '05 #1
6 3151
Abs <ab*@yahoo.co m> wrote:
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
suggestions, please?

Here there is the CSS file:

http://project.fotografist.com/styles/styles_black.css


It's difficult to know where to start. Delete the entire thing, learn
more about html, css and javascript (why you shouldn't use it for
anything essential) and then start again from scratch is the best
approach here.

--
Spartanicus
Jul 20 '05 #2
Abs <ab*@yahoo.com> :

I'm trying to center horizontally the thumbnails (...)
You're trying to center virtually anything.
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
suggestions, please?
First rule of ciwas: Validate your code.
Second rule of ciwas: Clean your code.
Third rule of ciwas: Make a minimal testcase.

In your case the second rule is the most important one. You have got too
many elements and classes and you are using 'position', 'float' and even
'width' too much, which makes it hard to get the relations between boxes.
Not to mention the broken-as-designed Javascript gallery approach.

KISS!

However, automargining doesn't work, because of your left floating of the
list items, just make them 'inline' instead:

<ul class="thumbs">
<li><img class="off" src="/images/btnull.gif" ...></li>
<li><a href="..."><img class="on" src="/galleries/..." ...></a></li>
...
</ul>

ul.thumbs {
clear: both; /*for "fotografis t"*/
width: 800px;
margin: 0 auto;
list-style: none;
text-align: center;
}
.thumbs li {display: inline;}
.thumbs .off {border: none;}
.thumbs .on, .thumbs .over {border: solid 1px;}
.thumbs .on {border-color: #777777;}
.thumbs .over {border-color: #E69452;}

Something like that.
Some styles are inlined in the HTML code, though.


Yeah right, let those dumb ciwasians dig through your awful code. (To be
fair, I've seen much worse.)

You should use more selector grouping ("foo, bar {}") and shorthand
properties and pixel is not a good unit for 'font-size'.

--
"Anyone who slaps a 'this page is best viewed with Browser X' label on a
Web page appears to be yearning for the bad old days, before the Web, when
you had very little chance of reading a document written on another computer,
another word processor, or another network." Tim Berners-Lee, 1996
Jul 20 '05 #3
Abs
Christoph Paeper wrote:
First rule of ciwas: Validate your code.
Second rule of ciwas: Clean your code.
Third rule of ciwas: Make a minimal testcase.
Thanks for your suggestions
Not to mention the broken-as-designed Javascript gallery approach.

What do you mean ? Do I have to use the boring classical photo per page
approach ? What is wrong with using javascript ? My gallery is inspired
in the one I saw in the projectseven.co m site

Yeah right, let those dumb ciwasians dig through your awful code. (To
be fair, I've seen much worse.)


Sorry, I was asking for too much. Anyway, it's only a work in progress
so it's expected to have mistakes and redundant code.

I only wanted to know how to do a thing with CSS that can be easily done
with only HTML tables. Sometimes I wonder why some things are so
difficult to do in CSS. :)
Jul 20 '05 #4
Abs <ab**@yahoo.com >:

What do you mean ? Do I have to use the boring classical photo per page
approach ? What is wrong with using javascript ? My gallery is inspired
in the one I saw in the projectseven.co m site
You can do Javascript assisted image galleries, but you did it wrong, i.e.
not usable by people with Javascript disabled (there are many and not all
of them have a choice). I'll try to outline an approach, that degrades as
gracefully and uses as less mark-up as possible:

.fullsize {visibility: visible}

// Read with care, I'm by no means a JS expert.
addEvent(
document.getEle mentsBySelector ("ul.class>li>a "),
"click", function() {
document.getEle mentsByClass("p hoto").style.vi sibility="hidde n";
document.getEle mentById(this.h ref.substring(1 , this.href.lengt h-1)
).style.visibil ity="visible"; // or make two classes and switch
}, true);
// See <http://webdesign.criss ov.de/Scripting/> for getElementsByCl ass(),
// getElementsBySe lector() and addEvent(). There are other ways to do it.

<ul class="thumbs">
...
<li><a href="#img12">< img href="12.thumb. jpeg" alt="..."></a></li>
...
</ul>
...
<div class="photo" id="img12">
<img src="12.jpeg" alt="..."><br>C aption
</div>
...

But note, that not everybody wants to load all full-size images.
I only wanted to know how to do a thing with CSS that can be easily done
with only HTML tables.


Tables are not without pitfalls either. Judging fom your code you seemed
to know that block boxes are centered with auto-margins and inline boxes
with "text-align: center" for their containing box, i.e. parent. You just
put in too much else, which made it not work.

--
"Space may be the final frontier,
but it's made in a Hollywood basement."

Red Hot Chili Peppers - Californication
Jul 20 '05 #5
Christoph Paeper <ch************ **@nurfuerspam. de>:

.fullsize {visibility: visible}


Working with 'display' ('block' or 'none') might be the better approach
here.

--
Save the whales, eat more dolphins!
Jul 20 '05 #6
Abs <ab**@yahoo.com > wrote in message news:<2s******* ******@uni-berlin.de>...
Not to mention the broken-as-designed Javascript gallery approach.


What do you mean ? Do I have to use the boring classical photo per page
approach ?


You can load images from an index onto one page, without using
javascript. I do that here:
http://www.efn.org/~bsharvy/rsharvy/rsindex.html (the thumbnails are
at the bottom). Each thumbnail causes the larger image to load in the
same .php page, by passing the name of the image in the URL to the
page.
Jul 20 '05 #7

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

Similar topics

18
4215
by: Heath | last post by:
Is it proper to center images in a <div> by using the text-align: center property? Or is there a better way?
5
2649
by: Robert J. O'Hara | last post by:
For some time I've made use of the max-width property in CSS to cause my pages to appear as a centered block against a contrasting background. This works well in new browsers (Mozilla, etc.) and falls back fine in IE6 and lesser creations. As one who practices "classic" (i.e. dull) typography, this has always been satisfactory since I've always used one-column pages. I'm now trying a two column layout so I can include a sidebar, and am...
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>
3
7854
by: rsteph | last post by:
I'm using two divs to create a shadowed-box type effect. Within the top div I want to put an image. I can get the image to center right to left, but not top to bottom. I'm making a series of boxes, and the images in them aren't all the same size. So I've sized the boxes to mach the largest of them, and I want to center them, so those that are smaller will be in the middle of the first div. Here's the code on the page: <table border="0"...
3
3666
by: BT | last post by:
I have taken over the support of an existing webpage and I need to revise the page so that it is centered (left and right) on the screen instead of aligned on the left. I can do this easily, but there is a little JavaScript that doesn't work correctly after I center it. I have tried to realign the page with either <centertag or align="left" attribute, but the pictures displayed with the JavaScript get messed up with everything I've...
2
3062
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated and the number of them can vary greatly. They are all contained within a parent table cell, which is centred on the page. But I am unable to find a way of centering these table cells within the parent cell.
2
2232
by: tonsi | last post by:
I have a page but it wont center the div. Can anyone take a look at it and help. When I try to center in the body using text-align: center; it doesn't work with the main container (called Table_01). Please help! I would be ever so greatful. The page is located here: http://www.cpiequipment.com/test_site/index.html Here is the code: <html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
14
2528
by: issentia | last post by:
I'm working on this site: http://www.essenceofsoy.com/redesign/index2.html and I'm having a few problems with getting the layout exactly right. 1) When the menu items are rolled over, they cannot be clicked as links unless the mouse pointer is below the word. This happens in both Firefox and IE6. 2) In Firefox, the pink quote banner and two gray form boxes above and below the content aren't centered in the "content" div, and I can't...
1
2287
by: =?Utf-8?B?ZnJhbmt5?= | last post by:
Hello, I've created a table that has two rows that are span across three columns. The third row has three columns, each with an image. The last row is also span accross three columns. The span rows are centering their data. however, the row with three columns, each with images (myimages1-3) are not centering with the rest of the table. Any idea why? Thanks in advance!
4
5287
by: harryusa | last post by:
I am trying to center 2 images concentrically which are z-indexed to lay on top of each other making an image with a border from another image that has a transparent center. I need the images to be horizonally and vertically centered within a <TD> </TD> area. No matter what I do the two image just present one above the other, albeit centered, NOT on top of each other. I originally did the entire page layout in TABLES until I found out I.E. 7...
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
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...
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
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
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.