home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / CSS_InHeader.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  2.1 KB  |  47 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997 - 2003 The PHP Group                              |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Author:  Klaus Guenther <klaus@capitalfocus.org>                     |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: CSS_InHeader.php,v 1.1 2003/07/31 14:58:19 thesaur Exp $
  20.  
  21. require_once 'HTML/Page.php';
  22. require_once 'HTML/CSS.php';
  23.  
  24. // generate an instance
  25. $css = new HTML_CSS();
  26.  
  27. // define the various settings for <body>
  28. $css->setStyle('body', 'background-color', '#0c0c0c');
  29. $css->setStyle('body', 'color', '#ffffff');
  30. // define <h1> element
  31. $css->setStyle('h1', 'text-align', 'center');
  32. $css->setStyle('h1', 'font', '16pt helvetica, arial, sans-serif');
  33. // define <p> element
  34. $css->setStyle('p', 'font', '12pt helvetica, arial, sans-serif');
  35.  
  36. // create a new HTML page
  37. $p = new HTML_Page();
  38. $p->setTitle("My page");
  39. // it can be added as an object
  40. $p->addStyleDeclaration(&$css, 'text/css');
  41. $p->addMetaData("author", "My Name");
  42. $p->addBodyContent = "<h1>headline</h1>";
  43. $p->addBodyContent = "<p>some text</p>";
  44. $p->addBodyContent = "<p>some more text</p>";
  45. $p->addBodyContent = "<p>yet even more text</p>";
  46. $p->display();
  47. ?>