November 8, 200818 yr Evening Everyone, I have three images with descriptions underneath which need to be aligned together with even margins. something like the portfolio on http://www.webcreationuk.com/ what is the best practice to use when trying to get a good margin? I have just used (the width of the container div is 700px wide) .img_index{ width:175px; float:left; margin:20px; } Is this ok? I have a feeling a isn't right thats all.. Edited January 27, 201016 yr by Sam G added [code] tags
November 8, 200818 yr I haven't really done this myself. However if noone respondes by tomorrow i may play on one of my templetes for you and see if i can gain this effect. (without tables) I am a little tipsy right now..... So not best to be playing around with my CSS coding.... however having said that maybe i could..... I can play Pool and Bowl better when i am drunk.... maybe that applies to coding
November 8, 200818 yr .img_index{ width:175px; float:left; margin:20px; } Is this ok? I have a feeling a isn't right thats all.. IE6 will have a hissy fit with this perfectly acceptable piece of code. I recommend using this instead.... img_index { float: left; padding:20px; } You can specify width if you want, but I'd just make the images the right size to begin with, then you won't have any problems anyway. The reason for using padding instead of margin is that in IE6, if you float and add margin on the same side as your float, it will double (or increase - either way it's a total pain) your margin. Good luck. Edited January 27, 201016 yr by Sam G added [code] tags
November 9, 200818 yr <div class="gallery"> <img src="/images/the.jpg" width="113" height="75" alt="my image" /><br /> <b>Your Title</b><br /> <div class="description"> This is a description of the neat photo you took. </div> .gallery { font-size:90%; border: 3px double #999; width: 152px; height: 166px; float: left; text-align:center; padding: 5px 8px; margin: 6px 0 12px 8px; line-height: 18px; } .description { text-align:left; } Sample of one on a live site, Adjust widths and margins wanted and done. The title centers as well. To separate more add margins
Create an account or sign in to comment