Connecting Tech Pros Worldwide Forums | Help | Site Map

URLs display fine in Chrome and IE8, but not in Firefox 3.0.11

Newbie
 
Join Date: May 2009
Posts: 21
#1: Jun 29 '09
Hello,

My site prints out URLs in a table. In Chrome and IE8, the URLs look great. In Firefox 3.0.11, the URLs only display up until the second forward slash.

So for example, "nytimes.com/pages/world/americas/index.html" is just "nytimes.com/pages" in Firefox.

Any ideas why? The code is below.

Thanks in advance,

John

Expand|Select|Wrap|Line Numbers
  1. print "<td class='sitename'>".'<a href="http://'.$row['site'].'" class="links2">'.$row['site'].'</a>'."</td>";

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,662
#2: Jun 29 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


is the source code different in FF? (different browser display is usually caused by HTML/CSS/JS issues since PHP execution is not affected by the browsers)
Newbie
 
Join Date: May 2009
Posts: 21
#3: Jun 29 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


In FF, the source code says:

Expand|Select|Wrap|Line Numbers
  1. <td class='sitename'><a href="http://en.wikipedia.org/wiki/Miami" class="links2">en.wikipedia.org/wiki/Miami</a></td>
However, the page only displays "en.wikipedia.org/wiki" in FF.

The source code is the same in Chrome and IE8.
Newbie
 
Join Date: May 2009
Posts: 21
#4: Jun 29 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


Is there a way to change the CSS to make URLs display correctly in Firefox?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,662
#5: Jun 29 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


the only suspect I have right now is the overflow property.

maybe you should ask a Moderator to move this thread to the HTML/CSS forum, those guys usually know more about browser bugs.
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,754
#6: Jun 30 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


Quote:

Originally Posted by Dormilich View Post

maybe you should ask a Moderator to move this thread to the HTML/CSS forum, those guys usually know more about browser bugs.

Done ;-)
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,754
#7: Jun 30 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


You wouldn't have a link to this page, so we could see this for ourselves?

If not, could you post the CSS classes affecting the table?
Newbie
 
Join Date: May 2009
Posts: 21
#8: Jun 30 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


Expand|Select|Wrap|Line Numbers
  1. print "<table class=\"navbar\">\n";
  2. print "<tr>";
  3. print "<td class='sitename'>".'<a href="http://'.$row['site'].'" class="links2">'.$row['site'].'</a>'."</td>";
The CSS:

Expand|Select|Wrap|Line Numbers
  1. table.navbar {
  2.        margin-left:44px;
  3.     margin-top:0px;
  4.     text-align: left;
  5.     font-family: Arial, Helvetica, sans-serif ;
  6.     font-weight: normal;
  7.     font-size: 12px;
  8.     color: #000000;
  9.     width: 700px;
  10.     background-color: #A7E6FE;
  11.     border: 1px #FFFFFF;
  12.     border-collapse: collapse;
  13.     border-spacing: 4px;
  14.     padding: 4px;
  15.     text-decoration: none;    
  16. }
  17.  
  18. table.navbar td {
  19.    border: 2px solid #fff;  
  20.    text-align: left; 
  21.    height: 16px;
  22. }
  23.  
  24. table.navbar td a{
  25.    padding: 3px;
  26.    display: block;
  27. }
  28.  
  29. .sitename { width: 535px;
  30.             overflow:hidden;
  31. }
  32.  
  33. a.links2:link {
  34.      color: #000000;
  35.     text-decoration: none;
  36.      text-align:left;
  37.     margin-top:6px;
  38.     margin-bottom:2px;
  39.     margin-left:2px;
  40.     padding:0px;
  41.     font-family:Arial, Helvetica, sans-serif;
  42.     font-size: 12px;
  43.     width: 10px;
  44.     height: 12px;
  45.     vertical-align:middle;
  46.      }
  47.  
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,577
#9: Jun 30 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


Showing us the PHP does us no good. We need to see the generated markup, but I think this is not going to be a HTML/CSS or Firefox problem.
zorgi's Avatar
Member
 
Join Date: Mar 2008
Location: here
Posts: 107
#10: Jun 30 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


I think you need to remove "width: 10px;" from your a.links2:link

also

.sitename overflow:hidden; doesn't help
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,754
#11: Jun 30 '09

re: URLs display fine in Chrome and IE8, but not in Firefox 3.0.11


Quote:

Originally Posted by zorgi View Post

I think you need to remove "width: 10px;" from your a.links2:link

also

.sitename overflow:hidden; doesn't help

Ahh, I see.

On line #26 of the CSS the <a> tags for that table are made block elements. That, coupled with the absolute width and the hidden overflow on the <td> would cause this.

The solution, therefore, is like zorgi suggested: remove the width from the link.
Removing either the display: block or the overflow: hidden would also work, but removing the width is probably best given that layout.
Reply

Tags
php