|
Posted by AGw. (Usenet) on 01/18/08 23:15
On Jan 18, 9:29 pm, Andrew H <ahods...@gmail.com> wrote:
> On Jan 18, 4:04 pm, dorayme <doraymeRidT...@optusnet.com.au> wrote:
>
> > Here is a suggestion for a look:
> >
> > <http://netweaver.com.au/alt/andrewHodson.html>
>
> For that design, if I wanted to use that as say a theme and then
> create a number of pages with that template, would that require me to
> use that CSS style page, as opposed to the inline style?
You don't *have* to have the CSS as a separate stylesheet, but it
would certainly be easier for you. Suppose that you have the
following pages:
a.html
b.html
c.html
and you want each of those pages to have the same basic design. If
you have the CSS at the start of each HTML document, and want to make
a slight change to your design (by tweaking a colour, for example),
then you'd have to change the same code in each separate file;
however, if you have all your CSS in a separate stylesheet, you'll
just have to make one change in one place, and the formatting used for
all the files using that stylesheet will be instantly updated. Even
with just three pages it will save some time when changing your coding
to just have to do so in one place, and of course it's even more of an
advantage with more pages. A further advantage of having a separate
(or "external") stylesheet is that you don't run the risk of
accidentally making changes to the CSS in one HTML document but not in
others (or even worse still, making different changes to the CSS in
different HTML documents).
So, although it's not an absolute rule, it's generally best to have
your CSS in a separate stylesheet. To do this for your site, you'll
need to copy dorayme's CSS code from the HTML document, create a new
file called (say) "stylesheet.css", paste the CSS code into that file,
and then save it. Note that external stylesheets don't contain any
HTML code, and they also don't need any fancy stuff beside the CSS
itself; all they'll contain will just be the CSS rules (in dorayme's
example, that's everything from and including "body {" to "background:
#ddd;}").
Once you've moved your CSS code to the separate stylesheet, you can
delete everything from:
<style type="text/css">
to:
</style>
in your HTML document, replacing them with:
<link href="stylesheet.css" type="text/css" rel="stylesheet">
After that, you just need to upload the altered HTML file, and of
course the new stylesheet as well, and your HTML page will then look
the same as in dorayme's example. Just add that "link" code to the
"head" element of any new page you add to your site, and then that new
page will share the same CSS with the existing page.
--
AGw.
[Back to original message]
|