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
    Dec 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    position:absolute inside position:relative in Firefox

    Hey all, this is my first post in a long time... I've been a fan of this forum and hope you can all help me again like you have before. Here's my newest dilema.

    I have a code. (relative code only)

    PHP Code:
    <link rel="stylesheet" href="index.css" type="text/css">
    <table width="90%" border="0" cellpadding="0" cellspacing="0">
      <tr>
    <?
    $result 
    mysql_query("SELECT * FROM coupons"); //Selects from database

    if ($myrow mysql_fetch_array($result)) {
        do {
        
    $C_ID $myrow["C_ID"];
        
    $name $myrow["name"];
        
    $desc $myrow["desc"];
        
    $exp $myrow["exp"];

    if (
    $pos == 3){?></tr><tr><? $pos 1;}
    $pos $pos+1
    ?>
        <td width="38%">
        <div align="center" style="position:relative"><img src="images1152x864/coupon.jpg" width="293" height="233" /><br />
        <div align="center" style="position:absolute; top:8px; left:6px; width: 285px;" class="header2"><? echo $name?></div>
        <div align="left" style="position:absolute; top:55px; left:10px; width: 180px; height: 110;" class="desc"><? echo $desc?></div>
        <div align="center" style="position:absolute; top:185px; left:25px; width: 100px; height: 30;" class="exp"><? echo 'Expires:<BR>'.$exp?></div>
        </div>
        </td>
    <?
        
    } while ($myrow mysql_fetch_array($result));    
    }
    ?>
      </tr>
    </table>
    This works fine in IE... However in Firefox it does not... any ideas how I can get this to work on both?

    Thanks

    PK

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Hi mate,
    Any output to the browser is not a php issue (usually). This is a css issue thats comes about from IE's incorrect usage of the box model. But without knowing what you are looking for I can't really help you. As well, your $pos check for every third entry can be done using a modulus operator:
    if ($pos %= 3)...
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    New Coder
    Join Date
    Dec 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, i see what you mean, I'm sorry, I posted in the wrong forum. Can someone move this to CSS?

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Np mate, too bad I can't move it but good luck to you.
    I think I made an error there too, the check should be ($pos % 3 == 0). Yeah, that sounds better :P
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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