HTML Image spacing help, please?

HTML Image spacing help, please?

HTML Image spacing help, please?

Thread started by Envious AU on Sunday, 6:34pm August 12th with 8 replies. Views: 810

Envious AU

31 posts

6:34pm Aug 12th 12

Hi guys,
i am trying to make a webstore for my i.t assignment
i want to have two images ON THE SAME LINE (just small images) with a space between the two pictures.

my plan is to have two images on one line, then add info under each picture on the line underneath (just write what the product is, and the price)

please someone help me out. if you need more info i will message you

cheers

raf simons

6,190 posts

6:44pm Aug 12th 12

Have you tried turning it off and on again

Envious AU

31 posts

6:51pm Aug 12th 12

....

iI want to specify that i would like to no the code to put a space between the two images.
the code i have now is:
<div style=width:240px;"><img src=imagename.gif"><img src="imagename2.gif"/></div>

thouard

980 posts

7:13pm Aug 12th 12

put them into a table and have them as one <td align="left"></td> and then <td align="right"></td>

Slubb

841 posts

7:33pm Aug 12th 12

How big is the space you need? You're better off having them both within their own <div> and using margins.

Ianv2

1,987 posts

7:42pm Aug 12th 12

What you want to do is put a margin-right on the left img of say style="margin-right:10px" this will push the right image 10px away from the left one. If you find they are setting up underneath each other or some shit, try floating them both left.

www.w3schools.com/cssref/pr_margin-right.asp
www.w3schools.com/cssref/pr_class_float.asp

A great way of testing these things out is to use Chrome developer tools you can actually right click an element 'inspect element' and manually add stylings to the element and it updates in real time showing you the affect.

Envious AU

31 posts

7:44pm Aug 12th 12


What you want to do is put a margin-right on the left img of say style="margin-right:10px" this will push the right image 10px away from the left one. If you find they are setting up underneath each other or some shit, try floating them both left.

www.w3schools.com/cssref/pr_margin-right.asp
www.w3schools.com/cssref/pr_class_float.asp

A great way of testing these things out is to use Chrome developer tools you can actually right click an element 'inspect element' and manually add stylings to the element and it updates in real time showing you the affect.

Quote from Ian on the 12th of August 2012

Thanks mate, helped me alot

terrorv2

2,987 posts

1:02pm Aug 18th 12


put them into a table and have them as one <td align="left"></td> and then <td align="right"></td>

Quote from thouard on the 12th of August 2012

Do not listen to this idiot.

Tables for non-tabular data? GET THE FUCK OUT.

koil

7,014 posts

6:55pm Aug 26th 12

Ian @ got this.