The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> CSS Help
|
CSS problem (PHP-related?)
Discuss CSS problem (PHP-related?) in the CSS Help forum on Dev Shed. CSS problem (PHP-related?) Cascading Style Sheets (CSS) forum discussing all levels of CSS, including CSS1, CSS2 and CSS Positioning. CSS provides a robust way of applying standardized design concepts to your web pages.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

June 25th, 2001, 04:35 AM
|
|
Member
|
|
Join Date: Jun 2001
Posts: 12
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
CSS problem (PHP-related?)
I have a web page, written in PHP, that links to an external cascading style sheet. I have two declarations in my .css file, the second of which is a class:
BODY { background-color: #000000; }
.classexample { font-family: Impact; }
HOWEVER, only the first declaration works on my page!!! Why would the BODY style be imported and work correctly, but the class won't? If I embed the class in the page, it works fine, but it's a no-go from the external sheet.
I've checked and double-checked my syntax and everything seems okay. The only think I can think of that might be screwing things up is PHP, but I don't know how.
I'm totally baffled.
Thanks for any advice you might have. I am using IE 5.5.
(I guess I could just do a PHP include rather than the traditional HTML LINK tag, but I'm still curious as to why I'm having this problem.)
|

June 25th, 2001, 08:29 AM
|
|
Divine Wind
|
|
Join Date: May 2001
Location: Mongo
Posts: 24
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I doubt the problem is either PHP or (as might be more likely) browser related (IE5.5. is OK with this kind of thing). If you could copy and paste the part of the webpage where the CSS class is called then we might be able to see what the problem is. The main problem is usually leaving the full stop/period off the start of the class name i.e.:
myClass {
color: red;
}
Emps
|

June 25th, 2001, 01:41 PM
|
|
Member
|
|
Join Date: Jun 2001
Posts: 12
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Ok, here's the CSS code from the external style sheet:
.storytitle {
font-family: Impact, "Arial Black", Arial, Helvetica, sans-serif;
font-size: 14pt;
}
Here's the code I am trying to use to invoke it (note that this code is (a) nested inside a table, and (b) is from a php-included file - either of which may be causing problems):
print "<SPAN CLASS='storytitle'><A HREF='story.php?storyid=$storyid'>$row[title]</A></SPAN><BR>$row[activated], by $row[username]<BR>";
Still baffled.
|

June 25th, 2001, 01:50 PM
|
|
Junior Member
|
|
Join Date: Jun 2001
Location: Columbus, OH
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
I'm guessing you're trying to make the link use that style. I think you could do this and get rid of the span tags:
Code:
<a href="yourlink" class="storytitle">link</a>
If you're trying to make $row[activited] and/or $row[username] use the storytitle style you just put the </span> tag to early. (I'm guessing you're trying to make the link do it though.)
If that doesn't work try renaming your style to:
Code:
A.storytitle:link{ }
|

June 25th, 2001, 03:00 PM
|
|
Member
|
|
Join Date: Jun 2001
Posts: 12
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Well, I cut some parts out of my style sheet to see what would happen, and the problem seems to have solved itself. I guess there was something wrong with my sheet, but hell if I know what it was, since the part of the sheet I was actually using remained unchanged.
I wonder if it will pop up again?
Thanks for the help.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|