Results 1 to 3 of 3

Thread: Border code advice

  1. #1
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,291
    Thanks
    166
    Thanked 3 Times in 3 Posts

    Default Border code advice

    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 ?
    Last edited by theremotedr; 09-28-2013 at 11:04 AM.

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,030
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    The border attribute for images is deprecated so you should use CSS instead.

    You can specify a border inline with the style attribute;
    Code:
    <img alt="" height="92" src="photogallery/audi.jpg" width="287" style="border: 2px solid red">
    Or you can define it in your stylesheet;
    Code:
    img { border: 2px solid red; }
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,291
    Thanks
    166
    Thanked 3 Times in 3 Posts

    Default

    Perfect,many thanks.

Similar Threads

  1. Replies: 3
    Last Post: 05-31-2011, 09:11 AM
  2. Cleaning up my code.. a little advice?
    By BLiZZaRD in forum PHP
    Replies: 15
    Last Post: 11-20-2007, 01:43 PM
  3. Replies: 4
    Last Post: 05-17-2007, 04:07 PM
  4. Replies: 5
    Last Post: 05-14-2007, 05:31 PM
  5. code or advice needed
    By braduzzz in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 11-15-2004, 03:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •