I have a Php file for include functions and a css page. I am trying to make a include function to generate most of my html. I just can not figure out how to get the css file to be in the php include function I made.
<?phpe
function HTMLStart( $Title)
{
echo "<!DOCTYPE html>\n";
echo "<html>\n";
echo "<head>\n";
echo " <title>".$Title."</title>\n";
echo " <link href=\ 'IncLab.css' type=\"text/css\" rel=\"Stylesheet\" />\n";
echo "</head>\n";
echo "<body>\n";
}
?>
The problem I have is with the echo
line:
echo " <link href=\ 'IncLab.css' type=\"text/css\" rel=\"Stylesheet\" />\n";
I tried to use double quotes and get an error, so I tried to use single quotes for the "IncLab.css and got no error. I was wounding if this is the right way to do it.
Also, I made a navigation bar in my include file but how to I put in a class (For CSS) to get my links to line up correctly.
<?php
function PageNagivation()
{
echo "<!-- Nav of the page --> \n";
echo "<nav> \n";
echo '<div class="nav-item float-left"> <a href="IncLabPage1.php">Page 1</a>';
echo '<div class="nav-item end-float"> <a href="IncLabPage2.php">Page 2</a>';
echo "</nav> \n";
}
?>
The navigation bar works and display but does not display correctly. The problem i know lies with the <div class....
part of the code. How would i get it to work. Thanks.