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 February 1st, 2001, 03:36 PM
mstembri mstembri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Norcross, GA
Posts: 458 mstembri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
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!
__________________
- Mike Stembridge
http://www.georgiaoffroad.com

Reply With Quote
  #2  
Old February 1st, 2001, 03:55 PM
Remmis Remmis is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 6 Remmis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Remmis Send a message via AIM to Remmis
Not very experienced with CSS, but syntactically the only difference between your color definitions and size is that there is no space after the colon in

color:<? echo $p; ?> etc. and there is one after the font-size:. Maybe that's the problem. *crosses fingers* Also you don't technically need the semi-colon to end a statement if the "<?" and "?>" are on the same line. Not a big deal, just pointing out.

Reply With Quote
  #3  
Old February 1st, 2001, 04:06 PM
mstembri mstembri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Norcross, GA
Posts: 458 mstembri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Good suggestions, but unfortunately no dice.

The color will change, but not the font size.

Reply With Quote
  #4  
Old February 1st, 2001, 04:27 PM
zerodivide zerodivide is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 1 zerodivide User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I think the problem may be with your installed fonts and your font-family declaration. Try changing that declaration to "font-family: arial,sans-serif;" and I think that may help you out.

Also, it's usually cleaner to define font sizes in px instead of pt.

If that doesn't work out for you, you may want to double-check that your variables are actually getting assigned.

Hope this helps!

Reply With Quote
  #5  
Old February 1st, 2001, 04:28 PM
mstembri mstembri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Norcross, GA
Posts: 458 mstembri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
.css page, as parsed by broswer

p {font-family:arial; font-size:8pt; color:black}
p.sm {font-family:arial; font-size:8pt; color:black}
p.big {font-family:arial; font-size:12pt; color:black}

Looks A-OK to me.

.............

I'm testing a seperate phtml document, with only some text and the style sheet.

So far everything is working as it should.

I just substituted php variables for size numbers, and it works. Trying with colors and numbers... that works also. *scratches head*


Reply With Quote
  #6  
Old February 1st, 2001, 05:18 PM
mstembri mstembri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Norcross, GA
Posts: 458 mstembri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
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!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > PHP and CSS problem

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