Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Gotta be a way to "include" html from a seperate file!?

Posted on 2000-05-09
3
Medium Priority
?
184 Views
Last Modified: 2013-11-18
Hello,

I want to have a navigation bar on the side of my pages, but don't want to have to maintain the navigation bar in every single page....

Seems there has to be a way that a html document can "include" another files html... similar to how images are called/inserted into documents...

I asked a similar question earlier and people told me to use cgi/asp/javascript ... I don't want to go this route.... also, SSI is not an option....

Thanks,
Keith
0
Comment
Question by:keithedward
3 Comments
 

Expert Comment

by:semkin
ID: 2793492
Hi Keith!
In this case..
Isn't it easier to make the navigation bar as a separate frame? :)

regards, semkin
0
 
LVL 2

Expert Comment

by:harnal
ID: 2793528
Hmmm...Scripts or frames, that is the question.  Why do you not want to use scripting?  
0
 
LVL 2

Accepted Solution

by:
Ber earned 100 total points
ID: 2794612
A simple answer is to use frames as stated above Just in case you don't know how to use frames here is some sample code to get you started:

<HTML>

<HEAD>
<TITLE>Your title here</TITLE>
</HEAD>

<FRAMESET cols="20%,*">
<FRAME SRC="sidebar.html" >
<FRAME src="main.html" Name="main" scrolling=auto>
</FRAMESET>

<NOFRAMES>
Your no frames HTML here
</NOFRAMES>

</HTML>

Sidebar.html will be your navigation bar and main will be where your webpages are displayed.you must reference the "main" frame using target

eg.: <A HREF = "Page1.htm"  TARGET="main">Page1</a>

This will specify a link to a page called page1 and the link will show up on the side bar provided you put the code in the side bar page "sidebar.html"

The other thing to watch out for is case sensitivity. This is the root of a lot of problems especially where links are involved and I suggest that you keep everything in lower case.

HTH
Ber...  
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question