Welcome to WebmasterWorld Guest from 107.20.75.63

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php css implimentation

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

New User

10+ Year Member

joined:Apr 12, 2004
posts:3
votes: 0


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?
11:37 pm on Apr 12, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 0


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

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

New User

10+ Year Member

joined:Apr 12, 2004
posts:3
votes: 0


place it right in after the <?php tag?
12:26 am on Apr 13, 2004 (gmt 0)

Full Member

10+ Year Member

joined:Dec 3, 2002
posts:260
votes: 0


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 :).

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 0


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.

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

New User

10+ Year Member

joined:Apr 12, 2004
posts:3
votes: 0


Thanks dave, I'll browse that now.