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 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2007
    Posts
    34
    Thanks
    1
    Thanked 1 Time in 1 Post

    Clear Property Line Spacing

    Hi All,
    I'm having some trouble across browsers (IE vs. Firefox) with the Clear property and how many spaces my element comes down if I declare clear on one side. In Firefox it looks right to me, but in IE6 and IE7 the line height is way more than what I would like. Please look here for the example.

    The issue revolves around the search box in the upper right area. Notice in Firefox it is very close to the top menu, which I like because I can top pad it if need be. However, in IE the box jumps quite a few pixels down and brings the logo down as well. If I delete the "clear: right" property from the search class then the box jumps to the left of the top menu which I obviously don't want. How can I fix so that IE's doesn't bring the search box down so many pixels after the clear is declared?

    Any help would be greatly appreciated. Thanks in advance.

    mamamia
    Last edited by mamamia; 05-11-2007 at 01:50 AM.

  • #2
    New Coder
    Join Date
    Apr 2007
    Posts
    34
    Thanks
    1
    Thanked 1 Time in 1 Post

    Lightbulb

    Problem resolved. Apparently the issue wasn't so much the clear property at all. The issue was that IE gives all HTML form elements a certain height, whereas Firefox doesn't. So I simply put the following in my CSS to resolve the issue:

    Code:
    form {border: none;margin: 0;}

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,695
    Thanks
    22
    Thanked 1,832 Times in 1,816 Posts
    Hello mamaia,
    I alway put a little snippet in the CSS to zero out all default margins, padding and borders. Sometimes I add other things to that snippet that I want to reflect globally on the pages. Here is an example:
    Code:
    * {
    margin: 0;
    padding: 0;
    border: none;
    text-decoration: none;
    }
    When that little bit is added to your CSS you can specify your own measurements instead of having to deal with the different defaults from different browsers.
    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
    •