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
    New Coder
    Join Date
    May 2007
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts

    google chrome seems to ignore cellpadding + cellspacing

    ok so i have a table with a tr and two tds. first td contains an input(text), the second another input(image). the second input is supposed to be a button. ive set cellpadding and cellspacing to zero so that the text input and the image button can be attached with no spaces in between. this works fine in IE and FF but not in chrome. chrome keeps leaving a few pixels of space between the txt input and the button. i tried using css but nothing seems to work. any idea what chrome's problem might be?

  • #2
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Well since you didn't provide your site link or code, I can just guess and suggest setting a global reset:

    Add this to your stylesheet

    * {padding: 0; margin: 0; border: 0;}
    Teed

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts
    yeah that one works but i don't want to use it. sorry here's the code

    Code:
    <head>
    
    <style type="text/css">
    .search{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: #4D4D4D;
    border: 1px solid #CCCCCC;
    height: 21px;
    outline: none;
    }
    </style>
    
    </head>
    
    <body>
    
    <table cellpadding="0" cellspacing="0">
    <form method="post">
    <tr><td><input type="text" size="30" class="search"></td>
    <td><input type="image" src="button.gif" name="submit" id="submit" width="77px" height="21px"></td></tr>
    </form>
    </table>
    
    </body>

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    If the global reset works, whats wrong with using it?

    This rule sets all elements to 0 margin, padding, and borders. Different browsers apply different values to elements by default. Starting with all of them at 0 provides a "clean slate" so to speak. Then when you want to add those values on elements, you can do so specifically to each element.
    Teed

  • #5
    New Coder
    Join Date
    May 2007
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by teedoff View Post
    If the global reset works, whats wrong with using it?

    This rule sets all elements to 0 margin, padding, and borders. Different browsers apply different values to elements by default. Starting with all of them at 0 provides a "clean slate" so to speak. Then when you want to add those values on elements, you can do so specifically to each element.

    this can potentially effect the rest of my design. is there anything more specific that i can use? thanks for the replies by the way.

  • #6
    New Coder
    Join Date
    May 2007
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ok fixed it. needed a margin:0 for the text input element because apparently the margins belonged to that element and had nothing to do with the table. weird.

  • #7
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by arabab View Post
    ok fixed it. needed a margin:0 for the text input element because apparently the margins belonged to that element and had nothing to do with the table. weird.
    Glad you got it working.

    Just a link to some reading about the use of global resets and their advantages.
    Teed


  •  

    Posting Permissions

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