<!DOCTYPE html> <!--css_example.php-->
<html> <head>
<?php include 'css.htm';?>
</head>
<body>
<?php
$pageName = basename($_SERVER['PHP_SELF']); /* Returns The Current PHP File Name */ echo "<h3> " . $pageName . "</h3> "; echo " <a href='../my-php/read_code.php?file=" . $pageName . "' target='_blank'> View Code </a>";
?>
<table background="images/bg.png" style="width:98%" style="height:640px">
<tr> <td width=20% style="vertical-align:top"><br> <?php include 'menu.php';?> </td> <td height="95%" bgcolor="white" style="vertical-align:top"> <h2>Cascading Style Sheets</h2> <br> Cascading Style Sheets are used to insure uniformity throughout the website where they are used. For this example website I created the html for the background color, paragraph settings, text colors for H1 and H2 tags, table padding and table text alighnment settings, all together in a separate file, named css.htm. This file is called to insert it's contents between the header html tags, <head> </head> . I insert a PHP include file code in the page header for each webpage that I want the same CSS to be used. This way I only need to update one file, the css.htm file, to make changes that are uniform across all pages that use the cascading style sheet. <br> Here is an example of the php I used to include a file:<br><br> <?php include 'css.htm';?> <br><br> Here are the results while using the css.htm file which includes the page and table styles:<br><br> <h1>< H1 > This is the style and color set for the H1 html tag in the css.htm file. < /H1 ></h1><br> <h2>< H2 > This is the style and color set for the H2 html tag in the css.htm file. < /H2 ></h2><br> <h3>< H3 > the H3 style is not defined in the css.htm file. < /H3 ></h3><br> In the css.htm file the page background colors is set to #e6fff2, a pale green, and a little extra table padding is used, so that the text is slightly indented in each column.<br> <p>< p >This is an example of text between the paragraph tags using the setting in the css.htm file. notice it's not black. < /p ></p> Insert your CSS include file between the page head tags.<br>< head > <br><?php include 'css.htm'; ?><br> < /head > <br><br> Here's the contents of the css.htm file that loads between the head tags.<br> <br> <img src="images/css.jpg" alt="styles used on this website"><br><br> </td> </tr> </table>
</body> </html>
|