Kathy wrote:
I'm trying to learn CSS. Some general questions;
Some use pixel size for text, others use em's, others use words like
small. Is there a best way or does it depend?
We should be able to use px, ems, percentages and so on, but the
browsers acts up on us. IE/win can't resize fonts set in px, so we avoid
px for text or use different methods to get around that problem. Some
other bugs in IE/win, and differences between browsers, make us try to
find something that works for our own pages.
So yes, it depends.
Note: IE/win can override px, but few users seems to know that.
Similar question for colors, some use hex codes, some use words like
"navy", is there a best way?
There are few valid color-names available, so RGB written as rgb or hex
is preferred by most. The mix of Red-Green-Blue with 256 values each,
gives a much more fine-tuned color than color-names can achieve.
Color-names may still be used at times.
Some people use linking to the stylesheet, some use importing. Then
there's putting the CSS in the header. I see the advantage of using a
separate stylesheet as opposed to in the header, but if you have a
small site, say 5 or 10 pages, is there ever an advantage to not
using a linked stylesheet? What about linking or importing?
Similar styles across a number of pages are best kept in an external
stylesheet. External stylesheets speed up download (after the 1st page
has been loaded) and ease maintenance even on small sites.
Some fine-tuning of single pages, on top of a general stylesheet, may
some times be kept in the page head.
Linking or @importing is either a personal preference, or used as a
filter to avoid feeding styles to some old browsers. Maybe both.
I see most people are doing their best to completely avoid using
tables, but then I've seen a tutorial recommending a simple table
layout as a foundation, then using CSS to define everything. Is there
a reason to avoid tables altogether other than "I want to"?
Generally: tables are just the thing for tabulated data in many cases.
Tables used for layout of ordinary pages is what we try to avoid. Tables
may make the real content pretty inaccessible in complex pages, and
tables are also quite inflexible compared to non-table CSS styling.
We do in fact have something called CSS-tables, which imitates
table-look by imitating table-elements look and behavior as
display-definitions for ordinary non-table elements, but again: IE/win
doesn't support CSS-tables at all, and the other browsers are not too
good either.
---
Most of our choices reflects the balancing-act between CSS-standards and
browser-support for those same standards. No browser has perfect support
yet, so many compromises have to be made. Once we have reached a
comfortable level of control, we usually ease off a bit.
It's all very much *personal preferences* at play, but also knowledge
after studying standards and all the many thousands of browser-bugs
and flaws. We prefer different end-designs, so we apply different
methods and strategies.
Many strange solutions are simply ways to avoid or work around
browser-bugs and flaws, and we all have our own experiences and
preferences in what we call "bug-killing".
My own preference is that a web page should work alright without CSS,
and then I can style it as far as I like -- using all available standard
definitions (and most often some extra non-standard CSS too, just to
make IE/win behave like a browser -- nicely put away in a commented
stylesheet).
regards
Georg
--
http://www.gunlaug.no
______________________________________________________________________
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/