How do i add external css to a php file?

Hi,
Glad you solved the problem, and thanks for telling.

Nice to link to your finding, but I rather have the answer posted here.

If you were a member at StackOverflow you would know that SO recommends their posters to not link to, but to cite other places in their posts so their users do not have to rely on other sites to understand/read your message.

So I’ll put an answer here anyway, so you don’t have to go to SO to read.

You link to the stylesheet in the html outputted by the php script, e.g.:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <link href="/stylesheet.css" media="all" rel="stylesheet">
</head>
<body>
<?php include("header.php"); ?>
<?php include("content.php"); ?>
<?php include("footer.php"); ?>
</body>
</html>
2 Likes