help@import

liunx

Guest
On my site I have a header and a navigation bar at the top of each page. Also a logo etc.

<div id="banner">
<div id="bannertext">georgelangenberg.com<span class="style4">/yoga</span></div>
<div id="darshan">Yoga Darshan</div>
<div id="message">
<div class="menuBar"> <a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"lessen.htm">yoga</a> <a class="menuButton" href="locatie.htm">info</a>
<a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"contact.htm">contact</a> <a class="menuButton" href="vraagteken.htm">?</a>
<a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"english.htm">english</a> <a class="menuButton" href="index.html">home</a>
</div>
</div>


As my site is slowly expanding I don't want to copy and paste page by page when I make any changes to the menu.

Correct me if I'm wrong: I can use '@import' to import this HTML code from another file, right?
Does this need javascript?

If you know how to do this please explain, or direct me to a simple tutorial for a beginner in css.

thanx George

btw this is the link to the website (<!-- m --><a class="postlink" href="http://www.georgelangenberg.com/yoga">http://www.georgelangenberg.com/yoga</a><!-- m -->) I'm talking about@import is for including CSS files. You cannot import HTML in this way. If you want to include your menu on every page then I suggest you get a host that supports server-side includes.so you say the only correct way tot do this is via php for example?

hmmm :mad: my server doesn't provide this.Not neccesarily PHP, just server-side includes. If your site isn't vey big yet then a change in host might be best.

<!-- w --><a class="postlink" href="http://www.brinkster.com">www.brinkster.com</a><!-- w --> have ASP support but the ad's are quite imposing.
<!-- w --><a class="postlink" href="http://www.freewebs.com">www.freewebs.com</a><!-- w --> have small ads and SSI support but you can only upload 1 file at a time.

If you want to pay for a host then there are millions out there, such as <!-- w --><a class="postlink" href="http://www.b-one.net">www.b-one.net</a><!-- w --> who are cheap and have server-side language support.

By the way, you should markup those links in an unordered list.you should markup those links in an unordered list.

I'm sorry man, this is why I find it difficult to learns css. I have no clue what you mean by this :confused:

Yeah Lavalamp my server does provide this, but I'm tight on the budget ( from Holland you know ;) )
Although the links you provided are very dheap indeed, I don't want to change fro the guys who are hosting my site now...Markup the links like this:<ul class="menuBar">
<li><a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"lessen.htm">yoga</a></li>
<li><a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"locatie.htm">info</a></li>
<li><a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"contact.htm">contact</a></li>
<li><a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"vraagteken.htm">?</a></li>
<li><a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"english.htm">english</a></li>
<li><a class="menuButton" href=http://www.webdeveloper.com/forum/archive/index.php/"index.html">home</a></li>
</ul>Then just apply the following styles to them:ul.menuBar{
list-style-type:none;
margin:0;
padding:0;
}

ul.menuBar li{
display:inline;
margin:0;
padding:0;
}Obviously if you want padding or margins on the .menuBar then add them in, I just put 0 values in for them as an example.

If your server does support SSI's then you can just move your menu code to a separate file and include the file into any page, one change to that file will affect every page (that may or may not be a good thing, one mistake and you'll have no backup).A SSI (server side include) would definitely work, but you can also create your banner and logo areas (if you're working in Dreamweaver or FrontPage) and save them as Library items (a nice way of creating SSI). Then, when you create new pages, you just insert the library items as needed. If you ever need to update them, you simply open the Library item (typically a saved .html file), make your changes, then you will be asked if you want the program to update all the pages that use the Library item (you click "yes" of course), and BAM! all the pages are updated. Then you just re-upload them to the server. This is one really nice reason to work in DW or FP. DW is much better at this and a hundred other things than FP.

Also, if you're creating ColdFusion, ASP, or PHP pages, you can create your banner/logo pages separately (again) and use code to just "include" them at the right spot on the pages. Then you just update the include pages as needed and all pages that call them will be updated automatically.

I hope this helps with the original question.:)If he has a big site then simply uploading all of the pages could take quite some time.True indeed Lava, which is why I mentioned the CF/ASP/PHP option. I'm becoming a huge fan of doing code once and making calls to it. I run into upload time issues myself and sometimes it discourages me from making changes. This is a good reason to plan your site in advance as much as possible.thanx guys,

really helpfull,
I'll change the code (after this weekend) but you see Lavalamp I don't underdstand why your code is called an unordered list. To me it seems more ordered then my initial code above...I used an unordered list because the links inside it are in no particular order. It wouldn't really matter if you were to swop the yoga link with the home link for example.

If it was a list of instructions though, then they should go into an ordered list (and use the <ol> tag) because the order of the list items does matter.thanx lavalamp, now I understand.

I'm learning... I'm learning
That's why :) I really like this forum.Always use the correct tag for the data it contains.

Happy to help. :)
 
Back
Top