473,378 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Trying to persuade CSS images to line up horizontally

I'm a CSS novice trying unsuccessfully to make three thumbnail images
display horizontally instead of vertically. I suspect I'm missing
something really stupid but I'll take the flak if someone could kindly
point me in the right direction (using words that the vicar's wife
would understand). The vertical thumbnails can be seen at the bottom of
this page: http://www.zen86793.zen.co.uk/gmga2008/index.html ... the
first image is in the right position and I want to move the other two
to the right of it.

Thank you for any help.

Stan

Jun 30 '08 #1
16 3545
In article <48***********************@news.zen.co.uk>,
Stan The Man <ma*@pr100.comwrote:
I'm a CSS novice trying unsuccessfully to make three thumbnail images
display horizontally instead of vertically. I suspect I'm missing
something really stupid but I'll take the flak if someone could kindly
point me in the right direction (using words that the vicar's wife
would understand). The vertical thumbnails can be seen at the bottom of
this page: http://www.zen86793.zen.co.uk/gmga2008/index.html ... the
first image is in the right position and I want to move the other two
to the right of it.
First - always - the HTML, see

<http://tinyurl.com/4papws>

--
dorayme
Jun 30 '08 #2
Stan The Man wrote:
The vertical thumbnails can be seen at the bottom of this
page: http://www.zen86793.zen.co.uk/gmga2008/index.html ... the first
image is in the right position and I want to move the other two to the
right of it.
Yes, do validate as dorayme suggested.

After you've done that, the immediate answer to your question involves
the width you've set for #pic.

You do not need HTML comment delimiters <-- --for your CSS.

Why not use display:none to hide your large pop-up images rather than
height:1px; width:1px?

Please, please don't use the clagnut method of screwing up Web sites.
Replace 62.5% in your body ruleset with 100%, and delete the 1.3em
et.al. you've added to compensate for it. I.e., in #container, replace:

font-size: 1.3em;
line-height: 1.3em;

with:

line-height: 1.2;

or just delete the line-height altogether. You can probably downgrade or
revise or delete the font sizing you've added to the h1 - h3 rules, too.

HTH

--
John
Wondering how slow-witted the vicar's wife is, since I haven't met her.
Pondering the value of the UIP: http://improve-usenet.org/
Jun 30 '08 #3
On 2008-06-30 08:33:12 +0100, John Hosking
<Jo**@DELETE.Hosking.name.INVALIDsaid:
Stan The Man wrote:
>The vertical thumbnails can be seen at the bottom of this page:
http://www.zen86793.zen.co.uk/gmga2008/index.html ... the first image
is in the right position and I want to move the other two to the right
of it.

Yes, do validate as dorayme suggested.

After you've done that, the immediate answer to your question involves
the width you've set for #pic.

You do not need HTML comment delimiters <-- --for your CSS.

Why not use display:none to hide your large pop-up images rather than
height:1px; width:1px?

Please, please don't use the clagnut method of screwing up Web sites.
Replace 62.5% in your body ruleset with 100%, and delete the 1.3em
et.al. you've added to compensate for it. I.e., in #container, replace:

font-size: 1.3em;
line-height: 1.3em;

with:

line-height: 1.2;

or just delete the line-height altogether. You can probably downgrade
or revise or delete the font sizing you've added to the h1 - h3 rules,
too.
It does help: thank you very much. I will look at those basic errors.
Will also try display:none (the code for the pop-ups was borrowed as it
is much too technical for me; I used it because it was the only hover
popup I could find which is entirely CSS rather than JS). The #pic
width is the native width of each thumbnail, ie 110px and I did try it
with only two images in case width was the problem but even then they
both displayed vertically. All three thumbnails display nicely in a
horizontal line if I use a table row to position them instead of the
CSS... so I even tried using the CSS inside the table cells but that
caused mayhem, unsurprisingly. My next step was going to be to try
using different #img relative positions for each image, or maybe
absolute positions instead... It's all trial and error for me.

Stan
Jun 30 '08 #4
Stan The Man wrote:
On 2008-06-30 12:02:42 +0100, "Beauregard T. Shagnasty" said:
>>
Why, oh why, is this [clagnut] practice proliferating so widely?

http://tekrider.net/html/fontsize.php

Thanks for the link. I was of course grouping font size with the other
'basic errors' which I said I would look into. I will report back when I
have done some fixing later today. Still struggling to my thumbnails
into a horizontal line though...
Well, from your earlier post, you must be done struggling now, right?
After you've changed your 110px in #pic to, say, 336px, your aunt's
spouse must be named Robert, and the thumbnails arrayed horizontally. Yes?
--
John
Jun 30 '08 #5
On 2008-06-30 13:21:18 +0100, John Hosking
<Jo**@DELETE.Hosking.name.INVALIDsaid:
Stan The Man wrote:
>On 2008-06-30 12:02:42 +0100, "Beauregard T. Shagnasty" said:
>>>
Why, oh why, is this [clagnut] practice proliferating so widely?

http://tekrider.net/html/fontsize.php

Thanks for the link. I was of course grouping font size with the other
'basic errors' which I said I would look into. I will report back when
I have done some fixing later today. Still struggling to my thumbnails
into a horizontal line though...

Well, from your earlier post, you must be done struggling now, right?
After you've changed your 110px in #pic to, say, 336px, your aunt's
spouse must be named Robert, and the thumbnails arrayed horizontally.
Yes?
I have fixed some (hopefully most) of the basic errors and reuploaded
to http://www.gardenmediaguild.co.uk/awards/index.html

Still can't get those thumbnails to line up horizontally though.
Changing #pic to 336px only gave me the same vertical lineup of images
with a new white block to the right, to the full height of the images.
All possible combinations of #pic dimensions have been tried and the
fix must lie elsewhere.

I also tried creating three different #pic classes, giving each one a
relative left position 114px greater than the previous one -- but this
only moved the second and third images to the right without lifting
them up to line up with the first image. This also messed up with my
hover enlargements which displayed on load instead of on hover.
(Haven't tried the display:none thing yet.)

I have also tried various float options and putting the div inside a
table row at various sizes, percentages and auto, but nothing works.

Unless you have another brainwave, I may be reduced to combining the
three thumbnails into a single image and figuring out if I can use
image maps to reproduce the hover enlargement...

Thanks again for your help.

Stan

Jun 30 '08 #6
Stan The Man wrote:
I have fixed some (hopefully most) of the basic errors and reuploaded
to http://www.gardenmediaguild.co.uk/awards/index.html

Still can't get those thumbnails to line up horizontally though.
Why don't you set a class on those images and make them

float: left;

--
-bts
-Friends don't let friends drive Windows
Jun 30 '08 #7
Stan The Man wrote:
>
I have fixed some (hopefully most) of the basic errors and reuploaded to
http://www.gardenmediaguild.co.uk/awards/index.html
get rid of:
<link href="css/agl-styles.css" rel="stylesheet" type="text/css"
media="all"/>
which contains markup and no rules.
Still can't get those thumbnails to line up horizontally though.
Changing #pic to 336px only gave me the same vertical lineup of images
with a new white block to the right, to the full height of the images.
All possible combinations of #pic dimensions have been tried and the fix
must lie elsewhere.
Two things to take care of your images:

#pic {width: 110px;} is the container for the images, which is too
small to take care of [3x110px + 3x1px + borders + offsets]. Change it to:
#pic {width: 344px;} /* 344px is the minimum here */

display:block will create a new line - stack images on top - remove it:
#pic a.p1, #pic a.p1:visited {/*display: block;*/}
In fact, you also use it in two other rules which are absolutely
positioned. They won't do anything there. This has nothing to do with
your problem in question.

--
Gus
Jun 30 '08 #8
Stan The Man wrote:
>
I have fixed some (hopefully most) of the basic errors and reuploaded to
http://www.gardenmediaguild.co.uk/awards/index.html

Still can't get those thumbnails to line up horizontally though.
Changing #pic to 336px only gave me the same vertical lineup of images
with a new white block to the right, to the full height of the images.
The whiteness comes from #pic { background-color: #ffffff; }.

The width is because the 336 is larger than 110 (but smaller than the
344 it needs to be, as Gus has pointed out).

The persistence of the vertical lineup even in a wider #pic is from the
#pic a.p1, #pic a.p1:visited { display:block; }.

Ditch the display:block, give #pic a larger width, and drop the white
background for #pic and #pic a.p1, #pic a.p1:visited (You might not need
the border on those links, either), and see how it looks. Be sure to
test it with images disabled or missing.

Do continue to work on validation the code, especially where you have
extraneous tags. Gus alluded to a problematic style sheet, which appears
to be referenced but missing.

I also tried creating three different #pic classes, giving each one a
relative left position 114px greater than the previous one -- but this
only moved the second and third images to the right without lifting them
up to line up with the first image. This also messed up with my hover
enlargements which displayed on load instead of on hover. (Haven't tried
the display:none thing yet.)
Try to avoid actually positioning anything, esp. absolutely. It's hard
to do right (and even harder to do right in all cases), for one thing,
but it's rarely necessary, IME.
>
I have also tried various float options and putting the div inside a
table row at various sizes, percentages and auto, but nothing works.

Unless you have another brainwave, I may be reduced to combining the
three thumbnails into a single image and figuring out if I can use image
maps to reproduce the hover enlargement...
No, no, don't do that. That's too much like work. :-)
>
Thanks again for your help.
YVW

--
John
Pondering the value of the UIP: http://improve-usenet.org/
Jul 1 '08 #9
On 2008-07-01 02:03:55 +0100, John Hosking
<Jo**@DELETE.Hosking.name.INVALIDsaid:
Stan The Man wrote:
>>
I have fixed some (hopefully most) of the basic errors and reuploaded
to http://www.gardenmediaguild.co.uk/awards/index.html

Still can't get those thumbnails to line up horizontally though.
Changing #pic to 336px only gave me the same vertical lineup of images
with a new white block to the right, to the full height of the images.

The whiteness comes from #pic { background-color: #ffffff; }.

The width is because the 336 is larger than 110 (but smaller than the
344 it needs to be, as Gus has pointed out).

The persistence of the vertical lineup even in a wider #pic is from the
#pic a.p1, #pic a.p1:visited { display:block; }.

Ditch the display:block, give #pic a larger width, and drop the white
background for #pic and #pic a.p1, #pic a.p1:visited (You might not
need the border on those links, either), and see how it looks. Be sure
to test it with images disabled or missing.
Eureka! Can't thank you enough for picking this out for me. I have
reuploaded to
http://www.zen86793.zen.co.uk/gmga2008/index.html
and the images are now arrayed horizontally at last... even though the
fix seems to have exposed an extraneous white-filled border below and
behind each image. I can make the fill colour disappear but can't see
where the stroke lines are coming from.

I also seem to have managed to make the fonts in this section display
too small but I think I should be able to find out why. One thing
slowing me down is that my GoLive preview window is a long way from
wysiwyg (all text displays massively oversized thus pushing the right
hand column down to the bottom of the page, so I have to preview every
change in my browser/s window/s.
Do continue to work on validation the code, especially where you have
extraneous tags. Gus alluded to a problematic style sheet, which
appears to be referenced but missing.
Yes, that style sheet came with the template and I think I can dispense
with it. Once I'm sure, I will clean up all references to it. And I
will put it through the validator once I get the page more or less
looking like I want it to.
>I also tried creating three different #pic classes, giving each one a
relative left position 114px greater than the previous one -- but this
only moved the second and third images to the right without lifting
them up to line up with the first image. This also messed up with my
hover enlargements which displayed on load instead of on hover.
(Haven't tried the display:none thing yet.)

Try to avoid actually positioning anything, esp. absolutely. It's hard
to do right (and even harder to do right in all cases), for one thing,
but it's rarely necessary, IME.
Thanks, I've abandoned that idea.
>I have also tried various float options and putting the div inside a
table row at various sizes, percentages and auto, but nothing works.

Unless you have another brainwave, I may be reduced to combining the
three thumbnails into a single image and figuring out if I can use
image maps to reproduce the hover enlargement...

No, no, don't do that. That's too much like work. :-)
Also abandoned!

Stan
Jul 1 '08 #10
On 2008-07-01 13:34:24 +0100, Stan The Man <ma*@pr100.comsaid:
Eureka! Can't thank you enough for picking this out for me. I have
reuploaded to
http://www.zen86793.zen.co.uk/gmga2008/index.html
and the images are now arrayed horizontally at last... even though the
fix seems to have exposed an extraneous white-filled border below and
behind each image. I can make the fill colour disappear but can't see
where the stroke lines are coming from.
Further testing suggests that the extraneous border is
browser-specific. I can see it on MacOs Safari but not on WinXP IE.

Stan

Jul 1 '08 #11
In article <48***********************@news.zen.co.uk>,
Stan The Man <ma*@pr100.comwrote:
On 2008-07-01 13:34:24 +0100, Stan The Man <ma*@pr100.comsaid:
Eureka! Can't thank you enough for picking this out for me. I have
reuploaded to
http://www.zen86793.zen.co.uk/gmga2008/index.html
and the images are now arrayed horizontally at last... even though the
fix seems to have exposed an extraneous white-filled border below and
behind each image. I can make the fill colour disappear but can't see
where the stroke lines are coming from.

Further testing suggests that the extraneous border is
browser-specific. I can see it on MacOs Safari but not on WinXP IE.

Stan
This layout is a hire wire act. Like some cars I have had held together.
You could

#pic a img {
border: 0;
padding: 0;
margin-bottom: -4px;
}

to get over this "font-size related" particular problem.

but there is other trouble.

--
dorayme
Jul 2 '08 #12
On 2008-07-02 01:16:53 +0100, dorayme <do************@optusnet.com.ausaid:
In article <48***********************@news.zen.co.uk>,
Stan The Man <ma*@pr100.comwrote:
>On 2008-07-01 13:34:24 +0100, Stan The Man <ma*@pr100.comsaid:
>>Eureka! Can't thank you enough for picking this out for me. I have
reuploaded to
http://www.zen86793.zen.co.uk/gmga2008/index.html
and the images are now arrayed horizontally at last... even though the
fix seems to have exposed an extraneous white-filled border below and
behind each image. I can make the fill colour disappear but can't see
where the stroke lines are coming from.

Further testing suggests that the extraneous border is
browser-specific. I can see it on MacOs Safari but not on WinXP IE.

Stan

This layout is a hire wire act. Like some cars I have had held together.
You could

#pic a img {
border: 0;
padding: 0;
margin-bottom: -4px;
}

to get over this "font-size related" particular problem.
Thanks for the hint. In Safari/Mac, margin-bottom: -4px didn't seem to
do anything; but by also giving padding-bottom -4px, the white bar at
the bottom of each image has gone... albeit still leaving behind a
black stroke from somewhere, but I'll find it.

As you have alluded to, I'm finding this template very difficult to
work with, not least because I don't know what some of the CSS code
does (and there are also plenty of classes in there which aren't used
anywhere) -- plus no doubt I have added my own problems to it. Methinks
I will probably start again from scratch, maybe using just one
stylesheet, but much wiser thanks to the much-appreciated help I've had
here.

Stan

Jul 2 '08 #13
In article <48**********************@news.zen.co.uk>,
Stan The Man <ma*@pr100.comwrote:
As you have alluded to, I'm finding this template very difficult to
work with, not least because I don't know what some of the CSS code
does (and there are also plenty of classes in there which aren't used
anywhere) -- plus no doubt I have added my own problems to it. Methinks
I will probably start again from scratch, maybe using just one
stylesheet, but much wiser thanks to the much-appreciated help I've had
here.
I agree it would be simpler in your case to have just one.

Any template this complicated and hard to troubleshoot and which uses
pixel dimensioned fonts and so on is not a good foundation for your
website page.

You can make this basic look you like (and it is fine by me too!) with
much simpler HTML/CSS.

--
dorayme
Jul 2 '08 #14
On 2008-07-02 03:48:39 +0100, dorayme <do************@optusnet.com.ausaid:
In article <48**********************@news.zen.co.uk>,
Stan The Man <ma*@pr100.comwrote:
>As you have alluded to, I'm finding this template very difficult to
work with, not least because I don't know what some of the CSS code
does (and there are also plenty of classes in there which aren't used
anywhere) -- plus no doubt I have added my own problems to it. Methinks
I will probably start again from scratch, maybe using just one
stylesheet, but much wiser thanks to the much-appreciated help I've had
here.

I agree it would be simpler in your case to have just one.

Any template this complicated and hard to troubleshoot and which uses
pixel dimensioned fonts and so on is not a good foundation for your
website page.

You can make this basic look you like (and it is fine by me too!) with
much simpler HTML/CSS.
Yes, I do like minimalist pages and no, the code is not in the least
minimalist... Could you enlighten me as to why anyone would need more
than one stylesheet unless targeting different media?

Stan

Jul 2 '08 #15
In article <48**********************@news.zen.co.uk>,
Stan The Man <ma*@pr100.comwrote:
On 2008-07-02 03:48:39 +0100, dorayme <do************@optusnet.com.ausaid:
In article <48**********************@news.zen.co.uk>,
Stan The Man <ma*@pr100.comwrote:
As you have alluded to, I'm finding this template very difficult to
work with, not least because I don't know what some of the CSS code
does (and there are also plenty of classes in there which aren't used
anywhere) -- plus no doubt I have added my own problems to it. Methinks
I will probably start again from scratch, maybe using just one
stylesheet, but much wiser thanks to the much-appreciated help I've had
here.
I agree it would be simpler in your case to have just one.

Any template this complicated and hard to troubleshoot and which uses
pixel dimensioned fonts and so on is not a good foundation for your
website page.

You can make this basic look you like (and it is fine by me too!) with
much simpler HTML/CSS.

Yes, I do like minimalist pages and no, the code is not in the least
minimalist... Could you enlighten me as to why anyone would need more
than one stylesheet unless targeting different media?
Oh, there are no absolute principles on this matter. If you want my
practice, I try to keep to one sheet. I succeed often with small sites.
But now and then it can become so long that I get tired of scrolling and
hive off a major bit of it, for example the css for navigation.
Sometimes on a complicated site, this can involve considerable length.

Other times I have used more than one stylesheet have been for sites
with big sections that need significant separate looks. Here I find a
main sheet that holds all the common things to the site as whole and
then I have separate additional sheets for each big section. These
additional sheets sometimes duplicate each other in a big way. But such
redundancy pays for itself handsomely in my not having to actually find
out what quite is common and what is not among the additional, section
specific sheets.

Yes, of course, in theory you would have all that is common in one
sheet. But theory and practice are different in that theory is never
under time pressure. Theory has a very easy time of it. It sits in a
very comfortable armchair indeed and acts as if there is no end to
tomorrows. <g>

In other words, do what you personally find very convenient. It will be
unlikely, if you do this conscientiously and not in panic or
thoughtlessness, to be something that others will find perfectly
understandable.

--
dorayme
Jul 2 '08 #16

Stan The Man wrote:
>
by also giving padding-bottom -4px
FYI, negative padding is invalid. A conforming browser must ignore it.
http://www.w3.org/TR/CSS21/box.html#padding-properties

At any rate, you can't depend on consistent rendering of invalid code.

--
Berg
Jul 2 '08 #17

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

Similar topics

4
by: metalseb | last post by:
Hi folks I built up a small website which is designed for 800x600 display. Runs just fine in this resolution but if you have a system in 1024 or 1280 pixels wide, the site just "sticks" in the...
0
by: BillGatesFan | last post by:
I'm trying to display line numbers in the stack trace so that when I write the stack trace to the error log table it will tell me what line the error occured on. But I'm reading in some places that...
2
by: Dave | last post by:
I'm trying to show line numbers in the vb.net IDE (2003 version on XP Pro). Am I out of luck? I can't find the setting. I can't use the debug mode either, but that's a problem for another day. ...
18
by: Fuzzyman | last post by:
Hello all, I'm trying to detect line endings used in text files. I *might* be decoding the files into unicode first (which may be encoded using multi-byte encodings) - which is why I'm not...
1
by: laredotornado | last post by:
Hello, What am I doing wrong in my regular expression? I'm trying to replace line break characters by responseText = responseText.replace(/(\r|\n)/, ""); However my response still...
1
by: lennyc | last post by:
I would like to make a simple auto scroll of images with little user interactioin. It would be images moving horizontally in a continuous loop that stops on mouse over and starts up again on mouse...
2
by: garandhero | last post by:
hey there, I am seeking some help in relation to centering multiple images with inline content, I have read the thread (http://bytes.com/forum/thread99970.html) and I tried the method described on...
4
by: manu1001 | last post by:
the trouble is the elements are defined in different places in the html file. something like this. <input id="a"...... /> <input id="b"...... /> <input id="c"...... /> <input id="d".........
5
by: chuckiechan | last post by:
This is what I would like it to do. Enter the search file to look in April_hours Enter your search item 50 150 #example of text in document April1, 50 100 150 75 200 April2, 100 150 200 75 250...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.