crmamx Posted April 17, 2011 Share Posted April 17, 2011 You probably know this story by now. I had a web site that used html, frames and inline css. Basically speaking, using [base target=content], the header, footer and menu never moved. All I had to worry about in developing programs was the content. I rewrote the site using php and external css and again I did not have to worry about the header, footer or menu, just the content. Now I am writing a new site using just html and external css. No frames of course and I don't want to use php. My problem is that in each program I have to include the code for the header, footer and menu as well as the content. Redundancy galore plus I am constantly changing the menu and consequently have to change 20 programs. The programs look like this: <div id="container"> <div id="header"> </div> <div id="content"> </div> <div id="aside"> <div id="menu"> </div> </div> <div id="footer"> </div> </div> If I link to a program that brings in the header, footer and menu, then they are not in the proper sequence. Without using frames or php, just html and css is there a way I can write the header, footer and menu just one time and reference it from my content program and have it in the right sequence? Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted April 17, 2011 Share Posted April 17, 2011 if i am honest i would just use a little snippet of php. and as far as frames i know of no other way to do what you want than including the header by using include. You need to save your file as .php ofcourse. Just do inside your header: <div id="header"> <?php include 'header.php'; ?> </div> And footer <div id="footer"> <?php include 'footer.php'; ?> </div> if anyone else knows a way other than php or frames i love to hear it Quote Link to comment Share on other sites More sharing options...
crmamx Posted April 17, 2011 Author Share Posted April 17, 2011 Yep, that is kind of what I had figured. But I am getting totally confused. It is ok to use php in the programs I am using to develop the tutorial. I did not want to use them in any of my examples and I don't have to. There is where my confusion was. But like I said before, sometimes I will get in my car and forget where I was going... cssfreakie to the rescue! Thanks pal.... Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted April 17, 2011 Share Posted April 17, 2011 But like I said before, sometimes I will get in my car and forget where I was going... haha, as long as you don't end up in a zoo where monkeys tear apart your car i guess it's okay. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.