inserting html into html

I created a website in photoshop sliced it up and saved for web. I want this one page to be the stationary page for the whole site meaning it never gets refreshed or changed. Instead, I sliced a cutout in this page that I want all the current web content to be located in. So I basically want to edit 5 simple html files and have them pulled into the cutout on the main page.

I also would like my links on the main page to be able to call each of these 5 html files when clicked.

I've played a little with server side includes but also want this html within the cutout to scroll instead of stretching the main site out of wack when there's too much content in it.

Is there possibly a javascript answer to this?
coffeebrandyAsked:
Who is Participating?
 
Chris StanyonConnect With a Mentor Commented:
You could also use iframes instead of a frameset, and set your links to  target the iframe,

<a href="page2.html"  target="myFrame">Page 2</a>

<iframe src="page1.html" name="myFrame" style="width:400px; height:300px;">
  <p>Your browser does not support iframes.</p>
</iframe>

Open in new window

0
 
remorinaCommented:
Have you tried using a frameset?
You can use frameset and call the links to update the content frame with your html pages

A simple example can be found here http://www.yourhtmlsource.com/examples/frameset1.html clicking the links to the left will update the right frame

More info http://www.w3schools.com/html/html_frames.asp
0
 
HicanCommented:
You could use php / javascript to do this and fill up a div. "Just" use a small javascript to fill the content div, like in the code below, to replace the lorem ipsum text with the content matching the menu links. Because it has a overflow: auto, it will stay within the given height of the element and not 'mess up' your page.



<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<style>
.wrapper
{
 width: 500px;
 margin: 0 auto;
}
.content
{
 width: 500px;
 height: 200px;
 float: left;
 border: black 1px solid;
 overflow: auto;
}
</style>
<body>
<div class="wrapper">
  <div class="content">
  		 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
			 been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
			 galley of type and scrambled it to make a type specimen book. It has survived not only five 
			 centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It 
			 was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum 
			 passages, and more recently with desktop publishing software like Aldus PageMaker including 
			 versions of Lorem Ipsum.<br />
			 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has 
			 been the industry's standard dummy text ever since the 1500s, when an unknown printer took a 
			 galley of type and scrambled it to make a type specimen book. It has survived not only five 
			 centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It 
			 was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum 
			 passages, and more recently with desktop publishing software like Aldus PageMaker including 
			 versions of Lorem Ipsum.<br />
  </div>
</div>
</body>
</html>

Open in new window

0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
MsMissConnect With a Mentor Commented:
I would use iframes for what you are tying to achieve here.  To further understand iframes, check out this page:

http://www.iframehtml.com/

It will break it down easily for you.
0
 
coffeebrandyAuthor Commented:
Thanks Chris and Ms,
I went with Iframes and it was actually pretty easy. Now I just gotta get my links to call these frames.
0
 
Chris StanyonConnect With a Mentor Commented:
Give your iFrame a name, like so

<iframe src="page1.html" name="myFrame" style="width:400px; height:300px;">

And then 'TARGET' that frame within your links:

<a href="page2.html"  target="myFrame">Page 2</a>
0
 
coffeebrandyAuthor Commented:
I chose iframes although I've read that frames are really not the way to go now days.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.