PDA

View Full Version : [CSS][HTML] Whitespace around image



RobsoN
4th March 2014, 17:30
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:
661



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.

kung foo man
4th March 2014, 17:34
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 :)

RobsoN
4th March 2014, 17:42
It works on the web, but not in my webiste ...

http://cssdesk.com/D4nEr

kung foo man
4th March 2014, 17:56
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:


http://www.youtube.com/watch?v=tdIk2PztcL0

RobsoN
4th March 2014, 18:01
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 :cool:

Thanks you Kung, because F12 told me everything ;)