CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 2nd, 2001, 03:42 PM
phreq phreq is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: New Zealand
Posts: 167 phreq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 3 sec
Reputation Power: 13
CSS - sometimes works, sometimes not... why?

Hi all,

I'm no CSS expert but I've never had much trouble with them in IE before! This has really got me stuck.

The classes are defined in a seperate sheet, like so:

-- style.css --

a.cathead {
font-family : Arial, Helvetica;
color : #FFFFFF;
text-decoration : none;
FONT-SIZE : 12px;
font-weight: bold;
}

a.cathead:hover {
font-family : Arial, Helvetica;
color : #FF9900;
text-decoration : none;
FONT-SIZE : 12px;
font-weight: bold;
}

a.cathead:visited {
font-family : Arial, Helvetica;
color : #FFFFFF;
text-decoration : none;
FONT-SIZE : 12px;
font-weight: bold;
}

-- end style.css --

and are called in index.php

PHP Code:
if (in_array($c$threetimes)) //If it's a multiple of 3, then it's on the end of a table row.
{
echo 
"<td width='25%' valign='top'><table width='100%' cellpadding='0' cellspacing='5' border='0'><tr><td bgcolor='$cR' align='center'><p><font face='Arial, Verdana, Helvetica' size='2' color='#FFFFFF'><b><a href='map.php?&sc1=$row[0]&catID=$row[0]' class='cathead'>&nbsp; $row[1]</a></b></font></p></td></tr><tr><td><p><font size='1'>$row[2]</font></p></td></tr></table></td><td width='3%' bgcolor='#FFFFFF'>&nbsp;</td></tr><tr>";
}
else
{
echo 
"<td width='25%' valign='top'><table width='100%' cellpadding='0' cellspacing='5' border='0'><tr><td bgcolor='$cR' align='center'><p><font face='Arial, Verdana, Helvetica' size='2' color='#FFFFFF'><b><a href='map.php?&sc1=$row[0]&catID=$row[0]' class='cathead'>&nbsp; $row[1]</a></b></font></p></td></tr><tr><td><p><font size='1'>$row[2]</font></p></td></tr></table></td><td width='3%' bgcolor='#FFFFFF'>&nbsp;</td>"



anyway, there are 25 records being printed out, into a 3-cell-wide table, so it goes records 1-3, new row, records 4-6, new row etc.

What is supposed to happen is that the category heading prints out as white 12pt bold, and when a mouseover occurs, the white heading changes to orange. This works SOMETIMES. Records 3,4,6,7 work correctly, as do 8,9 and 12... the ones that don't work just stay white.

The weird thing is that I know every repitition of that loop is going to print out exactly the same, with the class called the same way, spelt the same way etc.

So why does it sometimes work and sometimes not? And why do the links that don't mouseover still pick up that they should be white, 12pt bold etc, which is not the default, and yet not process the hover?

Any ideas? (*help, deadline!*)

Jen

Reply With Quote
  #2  
Old November 10th, 2001, 09:11 PM
MkJnr MkJnr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2001
Location: London, UK
Posts: 661 MkJnr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Send a message via AIM to MkJnr Send a message via Yahoo to MkJnr
sometimes happens to me, but refresh seems to fix it here

Donno why it happens tho?...

Reply With Quote
  #3  
Old November 11th, 2001, 12:35 AM
deepspring's Avatar
deepspring deepspring is offline
Is a Psycho
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: In your computer
Posts: 231 deepspring User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m
Reputation Power: 13
Send a message via AIM to deepspring Send a message via Yahoo to deepspring
Try putting "FONT-SIZE" as lower case and change the "px" (px = pixel) to "pt" (pt = point), i.e: "font-size: 12pt;" ...

If I remember correctly CSS is case sensative.

Give the following PHP code a shot... I replaced the single quotes with double quotes, because some browsers don't like single quotes in HTML.. don't remove the "\" in front of the double quotes.

PHP Code:
<?php
if (in_array($c$threetimes)) //If it\"s a multiple of 3, then it\"s on the end of a table row.
{
echo 
"<td width=\"25%\" valign=\"top\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\"><tr><td bgcolor=\"$cR\" align=\"center\"><p><b><a href=\"map.php?&sc1=$row[0]&catID=$row[0]\" class=\"cathead\">&nbsp; $row[1]</a></b></p></td></tr><tr><td><p><font size=\"1\">$row[2]</font></p></td></tr></table></td><td width=\"3%\" bgcolor=\"#FFFFFF\">&nbsp;</td></tr><tr>";
}
else
{
echo 
"<td width=\"25%\" valign=\"top\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\"><tr><td bgcolor=\"$cR\" align=\"center\"><p><b><a href=\"map.php?&sc1=$row[0]&catID=$row[0]\" class=\"cathead\">&nbsp; $row[1]</a></b></p></td></tr><tr><td><p><font size=\"1\">$row[2]</font></p></td></tr></table></td><td width=\"3%\" bgcolor=\"#FFFFFF\">&nbsp;</td>"
}

?>


God Bless
Scott
__________________
deepspring

- "Netscape 4 users are like lemmings... You can't help but laugh when one falls off a cliff"

Last edited by deepspring : November 11th, 2001 at 12:52 AM.

Reply With Quote
  #4  
Old November 12th, 2001, 04:20 PM
phreq phreq is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: New Zealand
Posts: 167 phreq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 3 sec
Reputation Power: 13
no luck...

Thanks for your suggestions... unfortunately no joy, but thank you anyway. Guess it's back to the drawing board!

Cheers,

Jen

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS - sometimes works, sometimes not... why?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap