Topic awaiting preservation: CSS In PHP |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: North Bay, Ontario, CA |
posted 08-18-2003 07:08 |
Bipolar (III) Inmate From: Berlin (almost) |
posted 08-18-2003 07:21
code: echo '<link rel="stylesheet" href="/path/to/styles.css" title="Default Site Styles" type="text/css" />'; should do it. |
Maniac (V) Mad Scientist From: :morF |
posted 08-18-2003 07:26
yeah...that should definatley do it. With PHP you have ot remember that if you have ot do anything that involves normal HTML code, stick it in an echo with single quotes around it, plug whatever you want in there and it will work...just make sure with things like links to style sheets that you put them right up the top of the page, since they're part of the header information. |
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 08-18-2003 10:55
You can also stick the html code into a print or echo statement with double quotes, you just have to remember to escape all the double quotes used in the html. So you could do: code: echo "<link rel=\"stylesheet\" href=\"/path/to/styles.css\" title=\"Default Site Styles\" type=\"text/css\" />";
|
Maniac (V) Inmate From: under the bed |
posted 08-18-2003 14:32
Just a little clarification - quote:
|
Bipolar (III) Inmate From: North Bay, Ontario, CA |
posted 08-18-2003 16:09 |
Maniac (V) Mad Scientist From: :morF |
posted 08-18-2003 16:35
*smacks head* That's right! Thanks DL |
Bipolar (III) Inmate From: Berlin (almost) |
posted 08-18-2003 17:59
KARN - Your version is almost OK as well, you just forgot the closing bracket at the end. |
Paranoid (IV) Inmate From: Den Haag, Netherlands |
posted 08-19-2003 12:17
Personally, call me sloppy if you like, but I can't see the point in doing that if you aren't setting your css filename with a variable within the statement. It would be much more readable to just turn off the php script, put the style tag into the text, and then turn on PHP again ... code: ?> unless you intend to implement some sort of skin switcher ... code: //some more code to determine the value of index and populate $arrayOfFilenames[]
|
Maniac (V) Inmate From: under the bed |
posted 08-19-2003 15:08
Good point trib. |
Nervous Wreck (II) Inmate From: Minnesota |
posted 08-25-2003 03:36
Or you could do quote:
|
Bipolar (III) Inmate From: |
posted 08-25-2003 15:08
this addresses Trib's point about easily readable php writing html (or anything else). code: print <<< HTML
|