View Single Post
  #7  
Old 06-28-2007, 06:51 AM
navaldesign's Avatar
navaldesign navaldesign is offline
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 10,533
Default Re: External file for style sheets

Let me first explain that css is NOT a file type. CSS is a particular stylesheet programming language that allowes you to define the way that some (or all) the elements of your page will look like. The file, if external, is saved with a .css extension, to make possible a specific call to the css file. Otherwise, a css file is simply text (as html, xml, js -javascript- and php files).

With this said, let me explaon how css based menus work. CSS menus ar nothing more than lists of text, each one corresponding at one of your pages.

So usually a css menu will show in your page, a list, but since this list is formatted (styled) according to the css code that you are using, it will show as similar to a classic BV menu.

Now, the css ONLY MAKES THE STYLING. The actual menu code must be in your page. When visited, the page will retreive the styling information from the external css file, and will "format" the menu list accordingly.

So, your menu.html file can NOT be imported as css file in the rest of your pages. Also, usually, the code of a menu is very small, so you don't really need to cut down its size.

Now, in your particular case: Since you are using so many menus (i have seen your post above) that would be somewhat complicated for you to setup all those style sheets as individual external css files, and isolate the menu codes to have in your page. Also, though it would cut down the html file size, it will NOT make your pages load faster (for the user) because, at the end, ALL the code, including that of the css fils, have to be sent from the server to the visitors browser. There would be a slight (irrelevant, just milliseconds) DELAY instead, because the server would need to open more than one files.

So i suggest that you simply use the php method described in the Tips and Trics section to embedd in your page the menu.php page (it needs to be php) which, in this case, would have both the css styling and the menu(s) code already in it.
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Reply With Quote