Log in

View Full Version : Border code advice



theremotedr
09-28-2013, 10:45 AM
Hi
I am trying to add a boder to the car manufacturers photos on the web page shown below.
http://www.ianparsons.info/

The existing code for the Audi photo is as follows.
<img alt="" height="92" src="photogallery/audi.jpg" width="287"></a><span lang="en-gb">

I thought the below code would be correct but no border is shown.
<img border="2" alt="" height="92" src="photogallery/audi.jpg" width="287"></a><span lang="en-gb">

Please can you advise where i have gone wrong in the code and advise the correct code to use.

Many thanks.

Update.
I have noticed that the code <img border="2" alt="" height="92" src="photogallery/audi.jpg" width="287"></a><span lang="en-gb">
works fine with no hyperlink.
As soon as a hyperlink is added the border is then nopt shown ?

Beverleyh
09-28-2013, 11:07 AM
The border attribute for images is deprecated so you should use CSS instead.

You can specify a border inline with the style attribute;
<img alt="" height="92" src="photogallery/audi.jpg" width="287" style="border: 2px solid red">

Or you can define it in your stylesheet;

img { border: 2px solid red; }

theremotedr
09-28-2013, 11:48 AM
Perfect,many thanks.