Hello,
I'm trying to find a way to setup a row of images horizontally, so that
the number of images will automatically fit the width of the screen
depending on the resolution on the user's monitor. For example, I
usually use something like this:
<div id="lrgcontaine r">
<div id="img"><a href="#">Name of Image <br /<img src="img.jpg"
alt="blah" /></a></div>
<div id="img"><a href="#">Name of Image <br /><img src="img.jpg"
alt="blah" /></a></div>
<div id="img"><a href="#">Name of Image <br /><img src="img.jpg"
alt="blah" /></a></div>
</div>
The styling behind said layout would be something like this:
#lrgcontainer {
width:800px;
}
#img {
margin: 0 50px 0 50px;
float:left;
}
And then if I need another row of images, I would do something like <br
style="clear:le ft;" /and repeat. However this (in my opinion) creates
a lot of redundant repetition of id="img", etc. Is it possible to fill
the width automatically with as many images as possible, and then when
there is no more room, put them on the next line down?
I'd appreciate any input.
Thanks,
Adam
I'm trying to find a way to setup a row of images horizontally, so that
the number of images will automatically fit the width of the screen
depending on the resolution on the user's monitor. For example, I
usually use something like this:
<div id="lrgcontaine r">
<div id="img"><a href="#">Name of Image <br /<img src="img.jpg"
alt="blah" /></a></div>
<div id="img"><a href="#">Name of Image <br /><img src="img.jpg"
alt="blah" /></a></div>
<div id="img"><a href="#">Name of Image <br /><img src="img.jpg"
alt="blah" /></a></div>
</div>
The styling behind said layout would be something like this:
#lrgcontainer {
width:800px;
}
#img {
margin: 0 50px 0 50px;
float:left;
}
And then if I need another row of images, I would do something like <br
style="clear:le ft;" /and repeat. However this (in my opinion) creates
a lot of redundant repetition of id="img", etc. Is it possible to fill
the width automatically with as many images as possible, and then when
there is no more room, put them on the next line down?
I'd appreciate any input.
Thanks,
Adam
Comment