Jump to content

PHP and CSS


wilna

Recommended Posts

Hi

I've tried to google php & css for over an hour now.  I have a file (*.php) with php code in it.  I would like to include css.  How do I get started? I know in an HTML file you insert css as follows:  <link rel="stylesheet" type="text/css" href="mystyle.css" />.  How do you do it in php?  Help will be apreicated.

Link to comment
https://forums.phpfreaks.com/topic/205737-php-and-css/
Share on other sites

PHP is a language which is read and executed by the server's computers and returns HTML to the viewer.

So you just tell the PHP to echo the include when you echo the rest of the HTML head

 

i.e.

echo '<html>
<head>
<title>My Web-Page</title>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>

<body>
</body>
</html>';

Link to comment
https://forums.phpfreaks.com/topic/205737-php-and-css/#findComment-1076589
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.