??? If you are working up multiple styles for a complex layout such
as a form, sometimes it??™s easier to write the styles as embedded
styles in the head of the document so that you don??™t have
to constantly switch between the markup and the style sheet.
Then, once everything is working, you can move the styles into
the main style sheet and replace the styles in the header with a
link to the style sheet.
??? Page styles override style sheet styles, but they lose out to attributes
you de?¬? ne in inline styles.
??? If you are sending an XHTML page to someone for a critique,
it??™s considerate to embed the CSS styles in the page, so the
reviewer only has to open the page and everything works; however,
for a Web site of any scale, there is really only one way to
manage the CSS and that is in a style sheet that can be linked to
all of the site??™s pages.
Linked Styles
Ideally, you place styles in a separate document (a style sheet) that
links to multiple pages so that the styles have global (site-wide)
HOW CSS WORKS 31
scope. The styles de?¬? ned in this style sheet can then affect every
page of your site, not just a single page or a single tag. This is the
only method of the three that truly separates the presentational
styles from the structural markup. If you centralize all your CSS
styles in a style sheet in this way, Web site design and editing
become much easier.
Pages:
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61