SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Zealot
    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!

  2. #2
    SitePoint Enthusiast
    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."

  3. #3
    Dumb PHP codin' cat
    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.

  4. #4
    SitePoint Zealot
    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.


  5. #5
    SitePoint Zealot
    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!

  6. #6
    Dumb PHP codin' cat
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •