SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE and this <br> issue

    Hi All,

    I am so confused about what is going on with this code I have. Below is a mini screenshot of where I am having this code issue:



    Notice the part where I have circled. It's fine and stuff. But here is the code for that part:

    Code:
    基督教家庭服務中心<br>
    翠林綜合職業復康服務<br>
    <br>
    <br>
    電話: 2703 6670<br>
    傳真: 2703 6767<br>
    電郵: <a href="mailto:vocrehab@cfsc.org.hk">vocrehab@cfsc.org.hk</a>
    I needed two <br> to produce the one line space between the first two lines and the last 3 lines for IE, but in FF in works fine. I know it has to do with my CSS coding somewhere, because when I just try this code by itself on a seperate page, both IE and FF produce the same results.

    So I was wondering if anyone has an explanation for this wierd thingy?

    Here is the link to the actual website:

    http://www.cfsc.org.hk/rehab/Occupat.../IVRS/ivrs.php

  2. #2
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This information I am grabbing is coming from a CMS I built. When the users make a line break the PHP uses the function nl2br to convert all the line breaks into <br> which is why I can't use <p> here.

    Any other alternative?

  3. #3
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post a link to the the page in question? If I am going to offer a solution I like to know it works for sure first.

  4. #4
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by FCC
    unfortunately this link is broken.

  6. #6
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm...It does what I think you expect, for me in IE6 (under WINE on Ubuntu) at 800x600...

    ---------------

    Suggested wildcard rule and deleted the suggestion as I noticed OP has it in CSS already.

  8. #8
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wozbk
    Hmmm...It does what I think you expect, for me in IE6 (under WINE on Ubuntu) at 800x600...

    For kicks add this style:
    Code:
    * { margin: 0; padding: 0; }
    The default padding and margin on elements does vary slightly from browser to browser - the code above makes things even so to speak - but you will need to explicitly adding padding and margin to elements as needed rather that relying on the browser defaults.
    So the double <br><br> actually results in two line breaks for in IE6? Because when I view it I only get one line break......But in FF, I get two lines (which is what I expect).

    Also, I've added the code margin: 0 and padding: 0 already....

  9. #9
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My bad - I just noticed you had the wildcard rule in there already.

    I see two line breaks in both IE6 and Firefox 1.5 (though I am on Linux I am running the "real" IE6 for all practical purposes).

    If it is possible to retrofit your CMS to wrap sections of text in paragraphs that would be more semantic and ideal - although it may be a pain to do.

    Doesn't mean we can't get what you have to work though.

  10. #10
    Brevity is greatly overrated brandaggio's Avatar
    Join Date
    Dec 2005
    Posts
    1,424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK - on further review, there are two line breaks in Firefox and one in IE6 - visually (as you already noted).

    It has been a long day - and my eyes is mad tied.

    It would seem you have two choices - feed different CSS to IE via a conditional comment or some other means or use <p> tags to wrap related text.

    The "difference" you are pointing out is a difference most would be willing to deal with/compromise on and live with, as a result of such varied rendering via the different browsers.

  11. #11
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bah. How come sitepoint can do the <br> trick but I can't get it to work.......

    Must I really use <p>.......

  12. #12
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    As mentioned above you should never use breaks just to make space in a layout but if you are restricted by your cms then you could try this.

    Code:
    #contact{letter-spacing:normal}
    The problem seems to be related to the letter-spacing:1px which you have in the body and is causing IE to do something strange with the breaks. You could remove the letter spacing for IE or just change it on that element as shown in my code above.

  13. #13
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Paul you truly are a CSS guru.


Bookmarks

Posting Permissions

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