|
Cascading Style SheetsCascading 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. Here is an example of the php I used to include a file: <?php include 'css.htm';?> Here are the results while using the css.htm file which includes the page and table styles: < H1 > This is the style and color set for the H1 html tag in the css.htm file. < /H1 >< H2 > This is the style and color set for the H2 html tag in the css.htm file. < /H2 >< H3 > the H3 style is not defined in the css.htm file. < /H3 >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. < 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 > Insert your CSS include file between the page head tags.< head > <?php include 'css.htm'; ?> < /head > Here's the contents of the css.htm file that loads between the head tags. ![]() |