SmokingMan Posted March 26, 2006 Share Posted March 26, 2006 I want a CSS menu on each page, the menu will be the same on all pages. Is there a way to link to it and have it as an external file, or do I have to code it into every page? Link to comment Share on other sites More sharing options...
Jonas Posted March 26, 2006 Share Posted March 26, 2006 Make a file called stylesheet.cssIn this file, put all the css info you want, without the <style> tags. Just plain css info in the format ofselector { css-info }Then, in the <head> section of your html documents, you write this:<link rel="stylesheet" type="text/css" href="stylesheet.css" /> Link to comment Share on other sites More sharing options...
boen_robot Posted March 26, 2006 Share Posted March 26, 2006 An important thing to note is that the method Jonas describes is going to style your menu through every page. However, if you want to change data, you would have to use some third language that would force a single data to appear everywhere. It could be a server side include, XSLT executed with JS and so on. Link to comment Share on other sites More sharing options...
Jonas Posted March 26, 2006 Share Posted March 26, 2006 Whoops, you're talking about the actual html code for the menu. Sorry about that. In that case, like boen said, a serverside language would be best to include a file. Or, if your host supports SSI (ServerSide Include), that's good enough.Include function in ASP (Active Server Pages):http://www.w3schools.com/asp/asp_incfiles.aspInclude function in PHP (Hypertext PreProcessor):http://www.w3schools.com/php/php_includes.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now