I'm forwarding this mail coz I've noticed it was sent directly to me
(and only to me), instead to the list. Sorry if I was mistaken though...
This is a reply from Ian Anderson.
Rizky wrote:
the content of master-import.css
@import url(main.css); @import url(about-page.css); @import
url(profile-page.css); ....
And so this is the file that I linked to the page templates. Btw, I
got this idea from the Macromedia website..
I agree with this; certainly you should not create a separate CSS file
for each page instead of a site-wide main file
However, I think that in terms of best practice, it would be
preferable to look for a slightly higher level of abstraction than
naming files according to the page they relate to.
You should be able to identify several different layout templates
within the site, and then name the additional files according to those
templates.
e.g. (this is all pretend, you understand)
main.css - generic styles and global formatting
two-col.css - specific styles for the about page
three-col.css - specific styles for the profile page
The thing here is that if you add a further page that has the same
layout as the about page, you absolutely:
a. Do not want to link to a file called about-page.css
b. Do not want to duplicate about-page.css as a further CSS file
Personally, I have few problems with the idea of putting genuinely
page-specific styles in the head of the page in question. I find there
are always one or two styles that are specific to one page only. It's
relatively easy to find and work with these exceptional styles.
However, this isn't good form, and even this can be avoided by giving
the body tag a class and ID attribute:
<body class="two-col" id="about_page">
Then you can keep all your CSS in a single linked file, or multiple
files as you prefer, but use contextual selectors like this to target
such incidental, one-off styles to a given page or set of pages:
body.two-col #sidebar {...whatever...}
body#about_page h2 {...foo...}
etc
Hope this helps
Cheers
Ian
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/