Use Php class to control the HTML page font : HTML Font « HTML « PHP

Home
PHP
1.Chart
2.Class
3.Components
4.Cookie Session
5.Data Structure
6.Data Type
7.Date
8.Design Patterns
9.Development
10.DNS
11.Email
12.File Directory
13.Form
14.Functions
15.Graphics Image
16.HTML
17.Language Basics
18.Login Authentication
19.Math
20.MySQL Database
21.Network
22.Operator
23.PDF
24.Reflection
25.Statement
26.String
27.Utility Function
28.Web Services SOAP WSDL
29.XML
PHP » HTML » HTML Font 
Use Php class to control the HTML page font


<?php
class MyPageFont{
     var $header_face = "Tahoma";
     var $header_size = "7";
     var $body_face =   "Times New Roman";
     var $body_size =   "5";
     var $footer_face = "Letter Gothic";
     var $footer_size = "2";

     function set_header($face, $size)
     {
         $this->header_face = $face;
         $this->header_size = $size;
     }

     function set_body($face, $size)
     {
         $this->body_face = $face;
         $this->body_size = $size;
     }

     function set_footer($face, $size)
     {
         $this->footer_face = $face;
         $this->footer_size = $size;
     }

     function header_text($text)
     {
         echo '<font face="' . $this->header_face . '" size="' . $this->header_size . '">';
         echo $text;
         echo "</font>";
     }

     function footer_text($text)
     {
         echo '<font face="' . $this->footer_face . '" size="' . $this->footer_size . '">';
         echo $text;
         echo "</font>";
     }

     function body_text($text)
     {
         echo '<font face="' . $this->body_face . '" size="' . $this->body_size . '">';
         echo $text;
         echo "</font>";
     }
}


$style = new MyPageFont();
$style->header_text("<BR>this is a header");
$style->set_header("Tahoma"6);
$style->header_text("<BR>this is a modified header");
$style->body_text("<BR>this is a body");
$style->footer_text("<BR>this is a footer");
?>


           
       
Related examples in the same category
1.Define function to change HTML text font
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.