| | |
image align
Please support our HTML and CSS advertiser: $6.99 Domain Names at 1&1. Includes Free Privacy. Save Now!
![]() |
how can i make a group of images to align up or down?
take a look:
http://www.freewebs.com/racoon200
What i wan't to do is that those images get down, so they woudn't bounce so much when you hover them.
take a look:
http://www.freewebs.com/racoon200
What i wan't to do is that those images get down, so they woudn't bounce so much when you hover them.
Have you tried specifying a height and width for each image?
[html]
<body>
<center>
<div id="macbar" align="middle">
<a href="http://www.google.com" target="body"><img src="img/ball.bmp" align="middle" height="50" width="50"></a><nobr>
<a href="http://www.google.com" target="body"><img src="img/sergant.bmp" align="middle" height="50" width="50"></a><nobr>
<a href="http://www.google.com" target="body"><img src="img/xbox.bmp" align="middle" height="50" width="50"></a><nobr>
</div>
</center>
<!-- --><script type="text/javascript" src="/i.js"></script></body>
[/html]
[html]
<body>
<center>
<div id="macbar" align="middle">
<a href="http://www.google.com" target="body"><img src="img/ball.bmp" align="middle" height="50" width="50"></a><nobr>
<a href="http://www.google.com" target="body"><img src="img/sergant.bmp" align="middle" height="50" width="50"></a><nobr>
<a href="http://www.google.com" target="body"><img src="img/xbox.bmp" align="middle" height="50" width="50"></a><nobr>
</div>
</center>
<!-- --><script type="text/javascript" src="/i.js"></script></body>
[/html]
Those things are annoying!
I hate pages which change just as I am about to click. I once bought something on eBay because the page shifted just as I tried to click on the bid button. It put the Buy It Now button where I clicked, and I didn't notice it had happened. I ended up paying more than I intended to bid.
I hate pages which change just as I am about to click. I once bought something on eBay because the page shifted just as I tried to click on the bid button. It put the Buy It Now button where I clicked, and I didn't notice it had happened. I ended up paying more than I intended to bid.
Daylight-saving time uses more gasoline
Make a table; put each of the images in their own table cell, and make this CSS apply to those cells:
Where I put "100px" for width and height: change that for the largest possible size that (or a tiny bit bigger than) an image can be. Now, when the images are small, they will sit in the middle of the cell; when they are big; they will fill the cell.
If you dislike tables for any reason; there's probably a hacky solution with auto-margins; but this is one of those case where, in my opinion, table is best.
CSS Syntax (Toggle Plain Text)
td.always_center { text-align:center; vertical-align:center; width: 100px; height: 100px; }
If you dislike tables for any reason; there's probably a hacky solution with auto-margins; but this is one of those case where, in my opinion, table is best.
Plato forgot the nullahedron..
It's not an incorrect use for a table; you want a row of columns of buttons - this is a tabular arrangement.
Tables are the only element that supports vertical alignment, which is why I suggest them. However; you might get something like what you want using a line of div elements, with CSS like:
Effectively; you'll be doing the same thing (you have to put each image into a div with class align_center)
If you want them aligned to the center of that bottom frame; you'll have to put them into another div (with a defined width) and set that to have margin left, margin right as auto.
Up to you really. I don't think anyone could rightfully say you were lazy for using tables for this. I think frames are lazier than tables =P
BUT I don't mind frames. They fulfil a purpose; if you need that purpose, it's not lazy to use something pre-existing.
Tables are the only element that supports vertical alignment, which is why I suggest them. However; you might get something like what you want using a line of div elements, with CSS like:
CSS Syntax (Toggle Plain Text)
div.align_center { width:100px; height:100px; /* same as before; replace 100px with the maximum size of your image */ float:left; } div.align_center img { /* this selector will apply to any image inside a div of class align_center */ margin: auto auto auto auto; }
Effectively; you'll be doing the same thing (you have to put each image into a div with class align_center)
If you want them aligned to the center of that bottom frame; you'll have to put them into another div (with a defined width) and set that to have margin left, margin right as auto.
Up to you really. I don't think anyone could rightfully say you were lazy for using tables for this. I think frames are lazier than tables =P
BUT I don't mind frames. They fulfil a purpose; if you need that purpose, it's not lazy to use something pre-existing.
Last edited by MattEvans; Mar 4th, 2007 at 10:20 pm.
Plato forgot the nullahedron..
![]() |
Similar Threads
- My Questions (JavaScript / DHTML / AJAX)
- html question (PHP)
Other Threads in the HTML and CSS Forum
- Previous Thread: Odd rendering problem in IE
- Next Thread: help!
Views: 7311 | Replies: 9
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 alignment background beta blog browser browserproblems cart center chrome code compatibility containers create css deleted design designing distortion div division divs dreamweaver drupal editor emailmarketing embed explorer fail firefox float font fonts format free frontpage google helprequired-urgent hosting hover html ide ie6 ie7 iframe image internet internetexplorer iphone js links list login macbook map maps margin marketshare microsoft missing mozilla mp3 newb object opacity opera override perl pnginie6 position positioning prevent problem relative seo shopping strings studio table tables tag templates text theme tips translation url validation visual w3c web webform website websitedesign windows7 word wordpress xhtml xml xsl






