Results 1 to 5 of 5

Thread: [CSS][HTML] Whitespace around image

  1. #1
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts

    Lightbulb [CSS][HTML] Whitespace around image

    Hello, I got weird problem with my edit button. I have in my table cell edit image as link, but when I add <a href = ..> then I got whitespace around the image (however image displays well without it).
    I tried many fixes on net, but no one want to work. It looks like this:
    Click image for larger version. 

Name:	edit2.PNG 
Views:	21 
Size:	1.2 KB 
ID:	661

    PHP Code:
    echo "...
    <table width="
    100%" cellpadding="1" cellspacing="1" border="0" class="forumline">
    ....
    <tr>... <td><a href=\"http://myextreme.pl/admin_panel.php?type=access_management&edit_
    $results[id]\"><img src= \"img/edit.png\" alt=\"edit\"></a></td>....</tr>
    ....
    </table>"
    ;

    CSS:
    .
    forumline{background-color#161616;border: 0px; } 
    How can I add image as link in table cell without this white space around? Thanks in advice.
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    1,968
    Thanks
    1,924
    Thanked 1,065 Times in 740 Posts
    Hey, please use http://cssdesk.com/ to share the actual HTML, so all ppl can try/see the error instantly and can try to fix it
    timescale 0.01

  3. #3
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    It works on the web, but not in my webiste ...

    http://cssdesk.com/D4nEr
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    1,968
    Thanks
    1,924
    Thanked 1,065 Times in 740 Posts
    Easiest is to check the CSS attributies with Firefox (Firebird plugin) or Chrome by just pressing F12, to open the Inspector, and then you can click on the element to see the CSS attributes.

    I guess there is just some "old" CSS code, which is applied to many elements and which rule you don't want on the a-tag anymore (so just overwrite it after you found it with Firebug).

    This video is a good introduction:

    timescale 0.01

  5. The Following User Says Thank You to kung foo man For This Useful Post:

    RobsoN (4th March 2014)

  6. #5
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    Oh.. I fixed it. It was really my mistake. I was using my old .css which has something like

    #content a{background:#fff; ... }

    which was inadvertently omitted by me

    Thanks you Kung, because F12 told me everything
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

Posting Permissions

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