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 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    88
    Thanks
    12
    Thanked 0 Times in 0 Posts

    How can i stop the browser from adding any whitespace at all?

    i have an td that is adding some space after and below the element in it.
    Is there a way to prevent this?
    I have set all the widths and heights correctly but it doesn't help. the extra space is still being added.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Compress your HTML source. Get rid of all whitespace in & around that element, including linefeeds. Browsers are supposed to ignore source code formatting, but don't bet the house on it.

    If that doesn't fix it, post the relevant code here (wth full image urls if they're involved).

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    Maybe you just have to resset margin and padding

    css:
    td {margin:0px;padding:0px;}


    yahoo provides a "reset.css" which is very helpful to
    get your site crossbrowser conform by resetting all
    elements.

  • #4
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    It is a good idea to start your css with this universal reset.

    *{
    margin:0;
    Padding:0;
    }

    Some browsers do not default to zero and this takes care of that. It resets all padding and margins to zero whether tables or regular css.
    It may mean that you need to adjust your existing settings a little.

    Also you should show us your cade and tell us which browser you find troublesome.

    Perhaps this may help you.

    I show it ot you as if I don't, somebody else will.

    Frank
    Last edited by effpeetee; 05-13-2009 at 11:50 AM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.


  •  

    Posting Permissions

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