Welcome to WebmasterWorld Guest from 54.226.147.190

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php css implimentation

     

CyanideRush

11:33 pm on Apr 12, 2004 (gmt 0)

10+ Year Member



I've got an external html css file. How do I apply it to a php file? specifically what is the code and where do I place it?

Birdman

11:37 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's the same as doing it in an HTML file. Just put the <link> tag in the head of the document.

<link rel="stylesheet" type="text/css" href="/stylesheet.css" />

Birdman

CyanideRush

12:23 am on Apr 13, 2004 (gmt 0)

10+ Year Member



place it right in after the <?php tag?

aus_dave

12:26 am on Apr 13, 2004 (gmt 0)

10+ Year Member



You need to make sure Birdman's code above is outside the PHP tags, either in the same file or in an included file containing your HTML.

PS Forgot to add Welcome [webmasterworld.com] to WebmasterWorld, CyanideRush :).

Birdman

12:29 am on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm sorry, I should have said it before. Make sure you are out of PHP mode when you add that line. Anything between the <?php?> tags is supposed to be PHP code and anything outside of the tags is treated as regular HTML.

Imagine this, you rename an HTML(page.html) page to php(page.php) and do not even change the file. No, <?php?> tags, just the same HTML page. It will render exactly the same as if it were named .html.

So, just look for the <head> section of the page and add the line in there. If you don't see a head section, then the file you are viewing is probably being included from a master file which does have the <head> section.

CyanideRush

12:30 am on Apr 13, 2004 (gmt 0)

10+ Year Member



Thanks dave, I'll browse that now.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month