applying css to php results?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
saviiour
Forum Newbie
Posts: 7
Joined: Fri Feb 27, 2004 1:11 pm

applying css to php results?

Post by saviiour »

I was curious. On one of my pages, i have an inlcude statement that links to a txt file.

Now iam creating a css file for my website. Is there a way to apply css to the result that comes out of that txt file?
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post by PrObLeM »

I think this will help

Code: Select all

<td class="really cool"><?php include("stuff.txt"); ?></td>
saviiour
Forum Newbie
Posts: 7
Joined: Fri Feb 27, 2004 1:11 pm

Post by saviiour »

so i just make a selector by the name of "really cool"

and add the css tag in the txt file

<link rel="stylesheet" href="lo.css" type="text/css">
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

If you include something into your current page it'll get formatted the same as the rest of the text.

Code: Select all

<?php
echo "<html><body>";
echo "<font color=#CCCCCC face=verdana>text";
include("file.txt");
echo "</font></body></html>";
?>
It'll all get formatted with grey, verdana font.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

ikk, font tags...

Mac
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Also, anything in that text file will get interpreted first as PHP and then as HTML. So you can write tags, classes, etc. into that text file itself and it will all style appropriately when included (assuming those classes are defined already).

Yes, big ick to font tags.

And, spaces in class names are a BAD BAD idea. So bad that they totally won't work. Underscores are also supposedly a no-no, although they will frequently work. hyphens and studlyCaps are the best way to go.
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

Unipus wrote:And, spaces in class names are a BAD BAD idea. So bad that they totally won't work. Underscores are also supposedly a no-no, although they will frequently work. hyphens and studlyCaps are the best way to go.
I thought PrObLeM was referring to two different classes? Hmmm...
Post Reply