Page 64 - Beginning PHP 5.3
P. 64

Part I: Getting Up and Running with  PHP
                     <body>
                       <h1><?php echo “Hello, world!”; ?></h1>
                     </body>
                    </html>

                Next, enter the following CSS code and save it as common.css in the same folder:
                    /* Page body */
                    body { font-family: Arial, Helvetica, sans-serif; }

                    /* Definition lists */
                    dl { width: 100%; margin: 2em 0; padding: 0; clear: both; overflow: auto; }
                    dt { width: 30%; float: left; margin: 0; padding: 5px 9.9% 5px 0;
                    border-top: 1px solid #DDDDB7; font-weight: bold; overflow: auto;
                    clear: left; }
                    dd { width: 60%; float: left; margin: 0; padding: 6px 0 5px 0; border-top:
                    1px solid #DDDDB7; overflow: auto; }

                    /* Headings */
                    h1 { font-weight: bold; margin: 35px 0 14px; color: #666; font-size: 1.5em; }
                    h2 { font-weight: bold; margin: 30px 0 12px; color: #666; font-size: 1.3em; }
                    h3 { font-weight: normal; margin: 30px 0 12px; color: #666; font-size:
                    1.2em; }
                    h4 { font-weight: bold; margin: 25px 0 12px; color: #666; font-size: 1.0em; }
                    h5 { font-weight: bold; margin: 25px 0 12px; color: #666; font-size: 0.9em; }

                    /* Forms */
                    label { display: block; float: left; clear: both; text-align: right;
                    margin: 0.6em 5px 0 0; width: 40%; }
                    input, select, textarea { float: right; margin: 1em 0 0 0; width: 57%; }
                    input { border: 1px solid #666; }
                    input[type=radio], input[type=checkbox], input[type=submit],
                    input[type=reset], input[type=button], input[type=image] { width: auto; }
                Run your new PHP script by typing http://localhost/hello_pretty.php into your browser’s
                address bar. You should see a more stylish page, such as the one shown in Figure 2-13.

















                             Figure 2-13





              26





                                                                                                      9/21/09   8:50:25 AM
          c02.indd   26
          c02.indd   26                                                                               9/21/09   8:50:25 AM
   59   60   61   62   63   64   65   66   67   68   69