![]() Topic awaiting preservation: CSS In PHP (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: North Bay, Ontario, CA |
![]() |
Bipolar (III) Inmate From: Berlin (almost) |
![]() 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 |
![]() 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 |
![]() 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 |
![]() Just a little clarification - quote:
|
Bipolar (III) Inmate From: North Bay, Ontario, CA |
![]() |
Maniac (V) Mad Scientist From: :morF |
![]() *smacks head* That's right! Thanks DL |
Bipolar (III) Inmate From: Berlin (almost) |
![]() KARN - Your version is almost OK as well, you just forgot the closing bracket at the end. |
Paranoid (IV) Inmate From: Den Haag, Netherlands |
![]() 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 |
![]() Good point trib. |
Nervous Wreck (II) Inmate From: Minnesota |
![]() Or you could do quote:
|
Bipolar (III) Inmate From: |
![]() this addresses Trib's point about easily readable php writing html (or anything else). code: print <<< HTML
|