Well, all the CSS can certainly easily be moved to an external .css file, though of course, there's always the HTML portion that must exist inline on the page. With regards to images of the CSS menu not showing up, the key to realize is that any image paths inside the CSS code is relative to the directory in which the external CSS file resides in, not the page the HTML is in. Take for example this line of the menu's CSS code:
Code:
background: url(media/bgpink.gif) bottom center repeat-x;
Without the CSS code being put inside an external css file, the image path (in red) here assumes that the images are in the sub directory called media beneath the directory where the HTML code for the menu is in.
Now, lets say you decide to put the entire CSS code inside an external CSS file and under a different directory, such as:
myfiles/menu.css
Once you do that, all image paths inside menu.css is now relative to the directory "myfiles". In this case, the easiest way to avoid confusion is just to put all the images of the CSS menu inside the same directory ("myfiles"), with any reference to directories inside the image paths removed:
Code:
background: url(bgpink.gif) bottom center repeat-x;
I know this can get confusing, but bottom line, remember:
"When putting a CSS code into an external css file, the key to realize is that any image paths inside the CSS code is now relative to the directory in which the external CSS file resides in, not the page the HTML is in."
Bookmarks