473,396 Members | 1,676 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,396 software developers and data experts.

images & justify

Ello...

Is there a way to recreate the "text-align : justify" behaviour with images?
(add to wish list: "image-align : justify") I have a gallery page and would
like all the images to properly justify in their containing <div>. I'm
currently centering them, which looks ok, but if there is a method of faking
justify with CSS I'd love to hear it! :)

P.
Jul 20 '05 #1
5 14112
"The Plankmeister" <pl******************@hotmail.com> wrote in
news:3f***********************@dread11.news.tele.d k:
Is there a way to recreate the "text-align : justify" behaviour with
images? (add to wish list: "image-align : justify") I have a gallery
page and would like all the images to properly justify in their
containing <div>. I'm currently centering them, which looks ok, but if
there is a method of faking justify with CSS I'd love to hear it! :)


I'm not quite sure what it would mean to "justify" an image. Justifying
text means diddling with the character and word spacing in order to make
the lines come out equal width. In an image, all the "lines" are equal
width by definition. Are you really talking about justifying a
*collection* of images? Do you really mean "I want to pack as many images
as possible into one horizontal group"? That should be easily achievable.
Do you also want to adjust the spacing between the images in order to
create as rectangular a grid of images as possible? If so, I'm afraid that
's a rather tall order, though if all your images are the same width,
you've got a special case that should also be easily achievable, though it
would involve a fixed inter-image spacing.

Jul 20 '05 #2
> I'm not quite sure what it would mean to "justify" an image.

Exactly the same as justifying text. Just swap the words for images.
Justifying
text means diddling with the character and word spacing in order to make
the lines come out equal width. In an image, all the "lines" are equal
width by definition. Are you really talking about justifying a
*collection* of images? Do you really mean "I want to pack as many images
as possible into one horizontal group"?


Yeah... I basically have this:

<div class="thumbnails">
<img .... >
<img .... >
<img .... >
<img .... >
<img .... >
<img .... >
<img .... >
<img .... >
<img .... >
<img .... >
<img .... >
</div>

Where each image has different widths but the same height.

Then I have this:

div.thumbnails {
text-align : center;
}

Which makes the images 'wrap' to the line so they take up all available
space before continuing on the next line.

I want to achieve an effect whereby the first image on each line has its
left edge lined up against the left edge of the div, and the last image on
each line has its right hand edge lined up with the right hand edge of the
div, and the spacing on each seperate line is dynamic to accommodate the
differently sized images. I'm pretty sure that's a good description of
'justify' if you swap "image" for "word".

Jul 20 '05 #3
"The Plankmeister" <pl******************@hotmail.com> wrote in message
news:3f***********************@dread11.news.tele.d k...
I'm not quite sure what it would mean to "justify" an image.


Exactly the same as justifying text. Just swap the words for images.


Well, I tried "text-align:justify" in IE6 with images and it worked just
like text. Howvever, if you look at text, you'll notice that the last line
of text is left aligned and not full justified. So while it does what it's
supposed to, it's probably not quite what you were hoping. Now, For IE5.5+
you do have a saviour: "text-align-last:justify". This will justify the last
line of text (or images).

Jonathan
--
http://www.snook.ca/
Jul 20 '05 #4
On Sat, 04 Oct 2003 02:17:22 GMT, "Jonathan Snook"
<go***************@snook.ca> wrote:
"The Plankmeister" <pl******************@hotmail.com> wrote in message
news:3f***********************@dread11.news.tele. dk...
> I'm not quite sure what it would mean to "justify" an image.


Exactly the same as justifying text. Just swap the words for images.


Well, I tried "text-align:justify" in IE6 with images and it worked just
like text. Howvever, if you look at text, you'll notice that the last line
of text is left aligned and not full justified. So while it does what it's
supposed to, it's probably not quite what you were hoping. Now, For IE5.5+
you do have a saviour: "text-align-last:justify". This will justify the last
line of text (or images).

Jonathan


I have a similar but completely different problem.
I have the same arrangement of thumbnails, placed back-to-back-to-back
so they wrap at whatever the user's resolution is.
But my images are all the same width, but a different height and I
would like to get them to line up along the horizontal middle rather
than the base, which is default. I tried putting align=absmiddle in
the img tag, which worked in IE but aligned the middle with the
baseline of the other images in Moz. Plus, it didn't validate under
Strict, so that went out the window.
Is there a way to "horizontally center" images that are wrapped in
this way?

(Apologies to Plankmeister for butting in on the original subject.)
Jul 20 '05 #5
On Sat, 04 Oct 2003 11:05:56 GMT, Jane Withnolastname
<Ja**********************@yahoo.com> wrote:
On Sat, 04 Oct 2003 02:17:22 GMT, "Jonathan Snook"
<go***************@snook.ca> wrote:
"The Plankmeister" <pl******************@hotmail.com> wrote in message
news:3f***********************@dread11.news.tele .dk...
> I'm not quite sure what it would mean to "justify" an image.

Exactly the same as justifying text. Just swap the words for images.


Well, I tried "text-align:justify" in IE6 with images and it worked just
like text. Howvever, if you look at text, you'll notice that the last line
of text is left aligned and not full justified. So while it does what it's
supposed to, it's probably not quite what you were hoping. Now, For IE5.5+
you do have a saviour: "text-align-last:justify". This will justify the last
line of text (or images).

Jonathan


I have a similar but completely different problem.
I have the same arrangement of thumbnails, placed back-to-back-to-back
so they wrap at whatever the user's resolution is.
But my images are all the same width, but a different height and I
would like to get them to line up along the horizontal middle rather
than the base, which is default. I tried putting align=absmiddle in
the img tag, which worked in IE but aligned the middle with the
baseline of the other images in Moz. Plus, it didn't validate under
Strict, so that went out the window.
Is there a way to "horizontally center" images that are wrapped in
this way?

(Apologies to Plankmeister for butting in on the original subject.)


Never mind! I just found the answer in another post:
vertical-align: middle
Duh.
BTW, to Plankmeister: I'm not really sure if I have a full grasp of
your question, but would you consider adding padding to your images to
make equal spacing? Make your body margins negative values to butt the
images up against the edge and use centering. Or maybe that won't
work. Just a thought. Thanks for starting the thread, anyway :)
Jul 20 '05 #6

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

Similar topics

12
by: CJM | last post by:
I've had some periodic problems on certain (intranet)servers where IIS seems to be caching thing in an unexpected way, or is server cached pages where new content is expected. The first...
1
by: josquin | last post by:
Hello, I am creating a page that features a large table with relative sizes, where the images therein are also relative in size, as in the following: <table width="100%" border="0"...
0
by: Jim | last post by:
Does anyone know where I can find a 'connected component' image processing function? I don't see it in numarray or scipy core... In matlab the function is called bwlabel(bw,4); and step 8 on...
7
by: J | last post by:
I am new to web design and I am looking for some advice on putting images within paragraphs of text. I have determined that sizing the height of my images to a given number of lines of text seems...
0
by: CHANAKYA | last post by:
hi I have one RAR files and it Contain 30 Images now I Want to Display it on IE so how it IS Possible kindly tell me
6
by: UKuser | last post by:
Hi Folks, Is there a way, I can hide images through CSS and then display the alt tags? I want to create a Javascript free CSS/Cookies approach to doing text- only. I've set the style for...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
7
by: YOGS | last post by:
how to draw a line in the bottom of the header & how to justify the text of a field in access report (to have justify in report output
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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,...

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.