Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts

    img inside a tag

    if I remove href img apears as it is, otherwise it has 1 pix border around it. Tryed text-decorattion: none, etc, nothing helps.

    How to sort this out ?


    Code:
    <a href = "#" >
      <IMG SRC="mcUser.png"  />
    </a>

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    css:
    Code:
    a img {
    	border: 0 none;
    }

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts
    Thanks.

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    You should also note, that
    Code:
    <IMG SRC
    is not valid Xhtml. It should be
    Code:
    <img src
    (lowercase, no uppercase in xhtml).

  • #5
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    The alt attribute is also required, both in HTML & XHTML.

  • #6
    Regular Coder oldcrazylegs's Avatar
    Join Date
    Feb 2004
    Location
    East Moline Illinois USA
    Posts
    414
    Thanks
    4
    Thanked 5 Times in 4 Posts
    Code:
    put your code all on one line without pressing the enter key until after </a>
    
    like this
    
    <a href="#"><IMG SRC="pcUser.png"  /></a>

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    I used to put this at the start of all my CSS files:
    Code:
    * {
    margin: 0;
    padding: 0;
    border: none;
    }
    But the border:none; like that removes needed borders on forms so now I do this:
    Code:
    ]* {
    margin: 0;
    padding: 0;
    }
    img {
    border: none;
    }
    And your link should look something like this <a href="http://nopeople.com/Design/"><img src="path/to/your/image.jpg" width="863" height="599" alt="description goes here" /></a>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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