SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Head elements in body

    Is there any extreme disadvantage to having head elements in the body?

    For example, I would like to arrange my site code to be like the following:

    <header SSI>
    content
    <footer SSI>

    However, this would not allow for me to update the title, etc. Could I produce the following?:

    <header SSI>
    <title>
    <additional JS, etc>
    content
    <footer SSI>

  2. #2
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I actually think I decided to do this:

    <html>
    <header></header>
    <header SSI>
    <content>
    <footer SSI>
    </html>

  3. #3
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,811
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yup, that's one option. I do something similar with php, if you have the functionality, feel free to steal:

    PHP Code:
    <?php

    $title
    ="My Title";
    $keywords="My, Keywords, are, placed, here";
    $description="My description goes here";
    //etc 

    include('header.php');
    ?>
    <p>Main content here</p>
    <p>Can be db drawn or hard coded</p>
    <?
    include('footer.php');
    ?>
    Then in header.php:

    PHP Code:
    <?php
    <!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    >

    <
    html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    <
    head>
    <
    title><?echo($title);?></title>
    <meta name="description" content="<?echo($description);?> />
    <meta name="keywords" content="<?echo($keywords);?>" />
    </head>

    <body bgcolor="#ffffff" text="#000000">
    <table width="645" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td>
    etc....
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •