...

View Full Version : Persistant



cooly291
01-22-2005, 01:57 AM
Am I to put the "persistant.css" in the place i want it to show? Like, I want my navibar to be persistant, so I only change that one css and it changes on every page, so do I put:

<link rel="stylesheet"
type="text/css" href="navibar.css" />

where I want the navibar to appear?


OR: If I am completely wrong tell me, lol!

Graft-Creative
01-22-2005, 02:34 AM
Nooooo.......I get the impression you are thinking of stylesheets along the same lines as includes.

Yes, if you have a stylesheet called navibar.css, any changes to that file will be effected accross your site, wherever you have an element with an id or class of navibar in your html.

However the method you mentioned of linking to your stylesheet is only allowed within the < head >< /head > of your html document.

What yo would need to do is link to your navibar stylesheet in the head of your document, then give your div, table, ul, or whatever way you are doing your nav, an id or class of "navibar".

So you would have something like this:



<link rel="stylesheet"
type="text/css" href="navibar.css" />

</head>

<body>
<div id="navibar">
<ul>
<li>home</li>
<li>about</li>
<li>contact</li>
<li>naked mud wrestling results</li>
<li>etc</li>
</ul>
</div>


hope that makes sense?

Gary

cooly291
01-22-2005, 02:45 AM
so if you list the elements of the navibar:

HOME
CONTACT
ETC.

Then the CSS. would be the way it is set up? You wouldn't just put the navibar in the CSS style sheet? What I am asking for is, how do I set up the CSS style sheet if you list the elements on the pages?

Graft-Creative
01-22-2005, 03:02 AM
it works like this, as far as I know - Say I visit your webpage: my browser downloads your stylesheet 'navibar.css' and caches it - now as it's downloading your html page, any element in your html doc, with a class or id of 'navibar' will have the css rules applied to it, that you previously assigned in your 'navibar.css' stylesheet.

Basically, you have two documents - html & stylesheet. Your html doc describes what the parts of your page are i.e. headers, paragraphs, lists etc; while your stylesheet dictates how these elements should look

That's all there is to it really...........well not quite, but.............

There are some great css menus here: http://css.maxdesign.com.au/listamatic/ if you want to study the relationship between html & css :)

Gary



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum