/    Sign up×
Community /Pin to ProfileBookmark

On my site I have a header and a navigation bar at the top of each page. Also a logo etc.
[SIZE=1]
<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=”lessen.htm”>yoga</a> <a class=”menuButton” href=”locatie.htm”>info</a>
<a class=”menuButton” href=”contact.htm”>contact</a> <a class=”menuButton” href=”vraagteken.htm”>?</a>
<a class=”menuButton” href=”english.htm”>english</a> <a class=”menuButton” href=”index.html”>home</a>
</div>
</div> [/SIZE]

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 [URL=http://www.georgelangenberg.com/yoga]this is the link to the website[/URL] I’m talking about

to post a comment
CSS

12 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonJun 05.2004 — @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.
Copy linkTweet thisAlerts:
@george71authorJun 05.2004 — so you say the only correct way tot do this is via php for example?

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

www.brinkster.com have ASP support but the ad's are quite imposing.

www.freewebs.com 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 www.b-one.net who are cheap and have server-side language support.

By the way, you should markup those links in an unordered list.
Copy linkTweet thisAlerts:
@george71authorJun 05.2004 — you should markup those links in an unordered list.[/QUOTE]

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

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...
Copy linkTweet thisAlerts:
@David_HarrisonJun 05.2004 — Markup the links like this:&lt;ul class="menuBar"&gt;
&lt;li&gt;&lt;a class="menuButton" href="lessen.htm"&gt;yoga&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="menuButton" href="locatie.htm"&gt;info&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="menuButton" href="contact.htm"&gt;contact&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="menuButton" href="vraagteken.htm"&gt;?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="menuButton" href="english.htm"&gt;english&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="menuButton" href="index.html"&gt;home&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
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).
Copy linkTweet thisAlerts:
@redbarronJun 06.2004 — 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.?
Copy linkTweet thisAlerts:
@David_HarrisonJun 06.2004 — If he has a big site then simply uploading all of the pages could take quite some time.
Copy linkTweet thisAlerts:
@redbarronJun 06.2004 — 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.
Copy linkTweet thisAlerts:
@george71authorJun 06.2004 — 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...
Copy linkTweet thisAlerts:
@David_HarrisonJun 06.2004 — 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.
Copy linkTweet thisAlerts:
@george71authorJun 06.2004 — thanx lavalamp, now I understand.

I'm learning... I'm learning

That's why ? I really like this forum.
Copy linkTweet thisAlerts:
@David_HarrisonJun 06.2004 — Always use the correct tag for the data it contains.

Happy to help. ?
×

Success!

Help @george71 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...