کد:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>My Website</title>
<link href="main.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="header">
<h1 id="header_title"> Welcome to my Site </h1>
<h2 id="slogan"> A Webdesigner Portfolio </h2>
<div id="navigation">
<ul id="main_nav">
<li id="home"><a href="#" title="home">home</a></li>
<li id="about"><a href="#" title="about">about</a></li>
<li id="portfolio"><a href="#" title="portfolio">portfolio</a></li>
<li id="services"><a href="#" title="services">services</a></li>
<li id="contact"><a href="#" title="contact">contact</a></li>
</ul>
</div>
</div>
<div id="content">
<h1 id="content_header"> What Can I Do For You ? </h1>
<p id="main_content"> Lorem ipsum vis eu hinc animal iuvaret, agam munere apeirian cum in. Erroribus suscipiantur ad vim. Eu qui euismod appetere scriptorem, duo in unum porro. Erant alterum cu qui, mea ut partiendo pertinacia, an sea viris alienum.
Ea duo viris intellegat, nam ut quando elaboraret. Populo omnium appetere et eos. Dicant docendi nominavi mel an, eam an probo consul. Eu has quem blandit maiestatis, soleat fierent ex ius.
Et cum facete propriae, mei eu aliquid urbanitas interesset. Nam ex docendi omittantur. Duo cetero laboramus ei, cu dolores accumsan persecuti ius. Liber vivendo vix id, mel ad omnis voluptatibus. Pri an accumsan appareat singulis, ne mel veri epicurei philosophia, te nam enim sonet dolorum.
Vis an sadipscing dissentiunt. Atqui omnium eos id, ei senserit erroribus sed. Est aeterno virtute id, harum aperiri graecis vel eu. Posse quidam nostrud mel no, habeo adipisci at mel. Has munere audire aperiam cu.
Ex vix cetero euripidis, ius tantas perfecto similique ne. Ea duo mundi detracto appareat, pri vocent menandri prodesset ex. Vide labores te vix. Illud aliquam eum ad. Mel in illud vidisse, nec tota iudicabit ad, pericula honestatis eum cu. Qui sonet utroque gloriatur id.</p>
</div>
<div id="sidebar">
<h3 id="recent_work_title"> My Recent Works </h3>
<div class="portfolio_image"> <a href="#"><img src="images/portfolio_1.jpg" alt="Image 1" width="104" height="104"></a> </div>
<div class="portfolio_image"> <a href="#"><img src="images/portfolio_2.jpg" alt="Image 2" width="104" height="104"></a> </div>
</div>
<div id="siteinfo">
<h4 id="siteinfo_title"> www.mysite.com </h4>
<ul id="siteinfo_nav">
<li><a href="#" title="home">home</a></li>
<li><a href="#" title="about">about</a></li>
<li><a href="#" title="portfolio">portfolio</a></li>
<li><a href="#" title="services">services</a></li>
<li><a href="#" title="contact">contact</a></li>
</ul>
</div>
</div>
</body>
</html>
با توجه به شکل سایت من ابتدا قسمت header سایت را جدا میکنم و آنرا در یک صفحه به نام header.php ذخیره میکنم، بدین صورت :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>My Website</title>
<link href="main.css" rel="stylesheet" type="text/css">
</head>
قسمت بعد navigation هست که کد آنرا از کل کد جدا و در صفحه navigation.php قرار میدهم :
<body>
<div id="container">
<div id="header">
<h1 id="header_title"> Welcome to my Site </h1>
<h2 id="slogan"> A Webdesigner Portfolio </h2>
<div id="navigation">
<ul id="main_nav">
<li id="home"><a href="#" title="home">home</a></li>
<li id="about"><a href="#" title="about">about</a></li>
<li id="portfolio"><a href="#" title="portfolio">portfolio</a></li>
<li id="services"><a href="#" title="services">services</a></li>
<li id="contact"><a href="#" title="contact">contact</a></li>
</ul>
</div>
</div>
همینطور برای content و ذخیره آن در صفحه content.php :
<div id="content">
<h1 id="content_header"> What Can I Do For You ? </h1>
<p id="main_content"> Lorem ipsum vis eu hinc animal iuvaret, agam munere apeirian cum in. Erroribus suscipiantur ad vim. Eu qui euismod appetere scriptorem, duo in unum porro. Erant alterum cu qui, mea ut partiendo pertinacia, an sea viris alienum.
Ea duo viris intellegat, nam ut quando elaboraret. Populo omnium appetere et eos. Dicant docendi nominavi mel an, eam an probo consul. Eu has quem blandit maiestatis, soleat fierent ex ius.
Et cum facete propriae, mei eu aliquid urbanitas interesset. Nam ex docendi omittantur. Duo cetero laboramus ei, cu dolores accumsan persecuti ius. Liber vivendo vix id, mel ad omnis voluptatibus. Pri an accumsan appareat singulis, ne mel veri epicurei philosophia, te nam enim sonet dolorum.
Vis an sadipscing dissentiunt. Atqui omnium eos id, ei senserit erroribus sed. Est aeterno virtute id, harum aperiri graecis vel eu. Posse quidam nostrud mel no, habeo adipisci at mel. Has munere audire aperiam cu.
Ex vix cetero euripidis, ius tantas perfecto similique ne. Ea duo mundi detracto appareat, pri vocent menandri prodesset ex. Vide labores te vix. Illud aliquam eum ad. Mel in illud vidisse, nec tota iudicabit ad, pericula honestatis eum cu. Qui sonet utroque gloriatur id.</p>
</div>