I have a php file that doesn't (for now) use any php code, that holds code for the header and main menu that will be used across all pages. The CSS file has no effect, even though I've created a style class for h1. The text "TEST" shows up, but the style is not applied. How do I properly include the CSS file?
mainMenu.php
<!--This code is included within the <head> of each page, and the stylesheet for the header and main menu are included here-->
<link href="styles/headerMenu.css" ref="stylesheet" type="text/css">
<!--Header and menu code-->
<div>
<h1>TEST</h1>
</div>
index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>untitled</title>
<?php include ('./includes/mainMenu.php') ?>
</head>
<body>
</body>
</html>
styles/headerMenu.cssis relative toindex.php? The path is correct ? Also you are including inheadsection ..divtags into the head tag there, also are you sure it is loading the CSS? Check f12 in your browser. Also check that you have applicable rules in your css/styles/headerMenu.cssmainMenu.phpis itself a full html file, how are you trying to include it in the head of other html/php file. Do check your use case first...