|
|
 |
|
Search
|
|
|
You are in ::::: Home |
style-sheets
|
|
|
 |
|
Cascading Style Sheets (CSS) allow managing the structure of the site
separately from content. Text styles and content can be modified
independently from each other, allowing developers to update web sites more
efficiently. CSS enables improving the appearance of the site, and can be
created with the same simple text editors as html. CSS give designers
additional control over typographic features such as line spacing, margin
indents, and font selection. It is possible to specify the position of
elements using CSS rather than the more memory-intensive transparent GIFs.
This allows files to be smaller and to be opened more quickly by browsers.
|
|
|
 |
- Define styles globally: Use centralised single style sheet
for all of the pages on the site (or possibly a few coordinated ones if
have pages with very different needs.
- Use to position elements: Using
style sheets to position elements gives more control and consistency.
- Use inheritance to propagate styles: CSS
employ a system of inheritance. To produce an efficient style sheet system
on a project, analyze the layout plan to see what features certain styles
share with other features, and then decide where in the inheritance scheme
every text formatting specification should take place.
- Use absolute and relative style specifications: To
avoid manual and tedious adjustments to styles, take advantage of absolute
and relative style specifications.
- Specifying fonts: When specifying fonts, provide the desired font, an alternate font, and a
default font.
- Define a clear policy: A system of Cascading Style Sheets can become complex, particularly on a
large site. Make it easy for other people to understand how the system
works so they can make any subsequent changes in an integrated manner.
Before adding a style sheet to an existing site, understand the existing
style sheet formatting policy.
|
|
|
 |
- Pages must continue to work when style sheets are disabled.
- It is fine (indeed, recommended) to use a long list of alternate fonts in the
style sheet specification for a given class of text: the user's browser
will pick the first available font in the list and use it throughout your
pages, meaning that the user will see a single font, making the site feel
typographically unified.
-
Do not use absolute font sizes; instead specify all text relative to the base
font size defined by the user's preference setting.
|
|
|
|
|