SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    img cross browser padding

    I have a block of code which retrieve news from my db. After every article i added img(last line of code here) to separate articles.
    But it looks different in ff, opera and ie.
    FF add one <br> space after image, opera render without padding at all, and IE render with double <br> line after img tag.
    How to solve this ?

    PHP Code:
    echo("<div style=\"margin:0px auto;width:280px;text-align:left;margin:0px;background-color:#FDF5E7;border:0px solid black;\"> ");
    echo(
    "<font size=\"2\" color=\"#82060A\"><b>$title</b></font></strong>");
    echo(
    "$imageID <font size=\"1\" color=\"\550C0E\">$newstext</font> <br><a href=\"readArticle.php?id=$id\"><font size=\"2\" color=\"550C0E\"><b>Read article</b></a></font><br>");
    echo(
    "</div>");
    echo(
    "<img src=\"/img/hor_line.gif\" height=\"1\" width=\"280\"> "); 

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    You are using deprecated tags such as font and br. They should not be used..if you provide a live link to the page we can help you.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried also with < /br> tag instead <br> but result is the same. Here is the link
    http://www.eparhijazvornickotuzlansk...gination34.php

  4. #4
    SitePoint Evangelist
    Join Date
    Apr 2009
    Location
    South Carolina
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using <br /> and see if that fixes your problem.

  5. #5
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jovalex View Post
    I tried also with < /br> tag instead <br> but result is the same. Here is the link
    http://www.eparhijazvornickotuzlansk...gination34.php
    It's actually <br /> but you can create vertical space by using vertical margins...why bother using deprecated elements?
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  6. #6
    SitePoint Evangelist
    Join Date
    Apr 2009
    Location
    South Carolina
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    It's actually <br /> but you can create vertical space by using vertical margins...why bother using deprecated elements?
    Are you saying the br tag is depreciated? I haven't seen that anywhere.

  7. #7
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    It IS deprecated because CSS has brought a way to bring vertical spacing without the use of unsemantic elements. margin-bottom will let you have vertical space.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  8. #8
    SitePoint Evangelist
    Join Date
    Apr 2009
    Location
    South Carolina
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just because there is more than one way to do something does not make one of them depreciated. Depreciated tags are tags that may not be supported in newer browsers because W3C has written the new standards with that tag removed.

    I do understand that CSS may well be the better way, but a quick way to break the data into multiple lines is with the br tag. It works, it is valid, and it has not been depreciated by W3C (as far as I know).
    Last edited by CSU-Bill; May 22, 2009 at 05:42.

  9. #9
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    If you want to use elements that clutter up your source code I certainly won't stop you.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


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
  •