SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: PHP and CSS problem
-
Feb 1, 2001, 16:39 #1
- Join Date
- Dec 2000
- Location
- Norcross, GA
- Posts
- 136
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The following is an example of what's in a cs.css.phtml style sheet:
p {font-family:arial; font-size: <? echo $sp; ?>pt; color? echo $p; ?>}
p.sm {font-family:arial; font-size: <? echo $spsm; ?>pt; color? echo $psm; ?>}
p.bbig {font-family:arial; font-size: <? echo $spbig; ?>pt; color? echo $pbig; ?>}
There is a table with size and color values for the styles defined above. The color portions work fine, however the size attribute is not working as intended.
When I link to the stylesheet (or include the code directly on the page itself), any p class style is treated as the first p above. In other words, <p class="bbig"> is the same size as <p>, despite having different numerical values.
Someone mentioned before that they had successfully managed to integrate PHP with CSS. I'd like to know if I'm doing this correctly, or if I'm missing something important.
Thanks!
-
Feb 1, 2001, 17:07 #2
- Join Date
- Jan 2001
- Location
- Helsingborg, Sweden
- Posts
- 31
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I doubt this has anything with PHP to do. If the style sheet code is generated with the correct values for p, p.sm and p.bbig, PHP is doing it's job. Check with the guys in #html on efnet. They know this stuff.
"Some people play hard to get - I play hard to want."
-
Feb 1, 2001, 17:07 #3
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I belive the only thing you are missing is that if you redefine an html tag it will override the settings. So since you set p to seomthing it overrides p.anything
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
Feb 1, 2001, 18:02 #4
- Join Date
- Dec 2000
- Location
- Norcross, GA
- Posts
- 136
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Could be, but that wouldn't explain why other .css sheets of mine work with p and p.somthing defined.
-
Feb 1, 2001, 18:17 #5
- Join Date
- Dec 2000
- Location
- Norcross, GA
- Posts
- 136
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Problem solved.
I used AddType to make apache parse .css files with php.
That seemed to do it. The external, php equipped style sheet is working like charm now.
Thanks for your input!
-
Feb 1, 2001, 18:20 #6
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I was just about to say try adding .css to the list of extensions that get parsed as php. like you figured it out on your own.
Please don't PM me with questions.
Use the forums, that is what they are here for.
Bookmarks