The CSS Anthology 169
The CSS Anthology: 101 Essential Tips, Tricks & Hacks | |
author | Rachel Andrew |
pages | 380 |
publisher | SitePoint |
rating | 8 |
reviewer | Bruce Lawson |
ISBN | 0957921888 |
summary | Structured Q&A guide for CSS beginners |
Author's credentials
Andrew is a long-term member of the Web Standards Project (WaSP) and programmer, technical project manager, technical team leader/senior developer and webmaster, according to her own bio.
Who's the book for?
The book's subtitle is somewhat misleading. There probably are 101 tips'n'tricks (I didn't count) but it's not the random miscellany that it implies. The information is structured so that a n00b could become proficient by reading the book from start to finish (I tested this out on a colleague). The tips'n'tricks structure does allow you to find what you're looking for in a hurry. The table of contents is easily scanned, and there is an excellent index.
The book doesn't offer advice on how to sex up the beauty of your site. That's fine for me; my current work involves replicating someone else's designs using xhtml and CSS, and as a coder I'm pathologically unable to design the type of showcases that you see at the CSS Zen Garden. A graphic designer might therefore find this book hard work; it jumps straight into a discussion of syntax, and there's occasional geek-directed statements (CSS supports multi-line C-style comments). Similarly, if you're completely new to html, this book probably isn't for you; there's lots of references to pre-CSS ways of working which could potentially be mystifying. Unusually for CSS books, there's a refreshing lack of polemic telling you why you should use style-sheets. If I read another history of the browser wars in a technical book, I shall scream.
So the book's constituency would seem to be those who know how to present information via html, and wish to take advantage of the smaller filesizes, greater flexibility and logical separation of the presentation layer from the mark-up that the (x)html/ CSS combination offers. The logical purity is my personal reason for moving to Web Standards; the trauma of writing text processing applications with VAX Fortran in the late '80s left me with the propensity to weep when I see html as sorely abused I mangled dear old Fortran.
Are you sitting comfortably? Then I'll begin.
Anthology kicks off in the conventional way for CSS books - controlling fonts and colours, styling hyperlinks, headings and the like. Each chunk is structured as a problem (How do I remove the indented left margin from a list?), a solution and sample code, and generally a discussion of related applications of the code, compatibility issues, accessibility notes etc. This is a pretty compact method of explication, and the basics of styling, syntax, pseudo-class order and the like are romped through in 40 pages, but not glossed over. The key to this is that Anthology assumes you know what you want to do, and shows you how to do it.
Chapter 4 (Navigation) is where the real meat begins - making navigation menus that are solely html unordered lists (because a menu is logically a list of links) and styling with CSS, adding rollover effects, styling navigation as buttons, changing the styling to a horizontal navbar, or even Amazon-style tabs without changing the mark-up. I suspect that, although these are techniques that can be found in most CSS books, the brevity and simplicity of the explanation will be revelatory to many. Chapter 5 (Tabular Data) may come as a surprise to those who mistakenly believe that web standards disallows the use of html tables, as it shows how to style tabular data - the examples are a spreadsheet and a calendar. Chapter 6 repeats the trick with that most mundane aspect of web development, the form.
Chapter 7 (Browser and Device Support) is about real-world CSS development. Unlike most books which instruct you to test in loads of browsers and leave it at that, this chapter lists all the main permutations of OS and browser (including tips on installing multiple versions of IE/ Win), and begins discussion of the tried and tested hacks to hide styles from Netscape 4, IE etc. All of this information is available on the web -- but for a newbie who isn't yet aware that it's possible to hide styles from certain browsers, it's a great way to introduce them to the murky practices of real-world CSS development. What's also refreshing in a computer book for n00bs is a discussion of how to seek help on lists and forums, with a guide to etiquette.
Chapter 8 (CSS Positioning and Layout) is where the stuff that stumps many a table-based designer begins. Along with fonts and colours etc, CSS can lay out the stuff on your page. I'm unsure about the success of this chapter; the Q&A structure is great if you're looking to build one of the sites that are explained (and the list is pretty comprehensive), but I came to the chapter hoping to cure a couple of bugs I'd found in a project I'd previously semi-successfully laid out with absolute positioning (A.P.).
Generally, I layout using floats as I also write the html, so it's easy to ensure that the markup spits out <div>s (sections) in the left-to-right, top-to-bottom order that I want to lay them out in. Suddenly, I had two projects that required A.P. for the first time, as it was not cost-effective to change the way that the client's CMS spat out the markup, so AP was required to position sections on the page regardless of where they appeared in the markup.
Anthology served me fine until I tested the page in IE and the layout was off. Nothing in the book gave me any pointers, and in the end I gave up Googling and just used a hack which exploits an IE parser bug to serve different co-ordinates to IE, after finding the hack co-ordinates through trial and error:
#APthing {position:absolute; top:34px; left: 758px; width:108px; height:88px;}
* html #APthing {position:absolute; top:19px; left: 785px;} /*for IE */
OK, so there may be a simple mistake I'm making -- but then, as far as absolute positioning goes, I'm the kind of newbie at whom this book is aimed, and I imagine that others will make the same mistake that I did. If the book had explained where I was going wrong, or given me the above hack, I'd've spent less time with Google and more time with Guinness.
Chapter 9 (Experimentation, Browser Specific CSS and Future Techniques) is successful, except for one small gripe. I'm glad that the author, although a member of the Web Standards Project, isn't an uber-purist. (I'm of the opinion that a little invalid code, if it's the only way to get the job done, isn't a hanging offense). So she shows how to implement IE-only proprietary CSS that can make colourful scrollbars, should you wish to do this. There's also a Mozilla-only CSS trick to allow curved edges to CSS boxes, which I implemented on my homepage that very evening.
However (here's the gripe), the most useful technique shown is one which allows fully-CSS flyout menus that don't rely on JavaScript. The author notes that it won't work for most people, as IE incorrectly restricts the hover pseudo-class to <a> tags only, while the CSS requires hovering over <li> elements.
Well, Yes and No. There's a well-documented and elegant hack which allows a proprietary Microsoft behaviour to be attached to the CSS that attaches a small JScript that corrects the IE bug, and thus allows this extremely useful CSS-only flyout menu to work in IE. I've used the technique myself when required to mimic the look and feel of a client's site while making it DDA/ADA accessible, and it works perfectly. To me, the omission of the IE hack from Anthology is an unfortunate oversight.
Summary
There's a couple of flaws in the book, though I suspect that in order to explain them, I've over-emphasised them. All in all, it's a solid, professional no-B.S. way for someone with a code-oriented mind to get them up to speed, satisfactorily and quickly; a motivated reader could be churning out standards-compliant, bandwidth-friendly sites after a few hour's experimentation. Ordering the book from the publisher's website was a good experience and, unusually, they have a money-back guarantee. As I said, I wish that I'd had access to Anthology when I was learning.
You can purchase The CSS Anthology: 101 Essential Tips, Tricks & Hacks from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Ok, let's take up a collection (Score:5, Funny)
Re:Ok, let's take up a collection (Score:5, Funny)
We need to get them help with their spelling and grammar, first.
An Oxford dictionary? (Score:2)
(Yes, it's a referral link. Any proceeds go towards actually buying the book for them. Shipping, if any, and the second half of the cost is out of my pocket.)
Re:Ok, let's take up a collection (Score:2)
As I said - small steps.
Re:Ok, let's take up a collection (Score:2, Informative)
I guess it's just easier to block the W3C validator [w3.org] instead.
I tried (Score:2)
"Phht. The Lion, The Witch, and The Wardrobe sucked.
Tables... (Score:1, Funny)
Learn online for free (Score:2, Informative)
Re:Learn online for free (Score:1)
Re:Learn online for free (Score:3, Informative)
Might not be newbie friendly, but its got an extensive list of resources.
Re:Learn online for free (Score:2, Informative)
Here's a handful of good CSS resources (Score:5, Informative)
Re:Here's a handful of good CSS resources (Score:2)
One project that I worked on had us testing against WebTV, for which this tool [msntv.com] came in handy.
Re:Here's a handful of good CSS resources (Score:3, Informative)
You wouldn't happen to know of a decent Mac-browser emulator would you?
Konqueror
If it works in Konqueror it should be fine in Safari. OmniWeb uses Safari renderer now and I don't think that anyone really uses IE for Mac anymore since it sucks hard (when I was still in High School the school got a brand new 766Mhz top of the line G4 and installed OS X Beta on it and I used that through X.2 on a daily basis before I graduated...oh how I shall miss thee, backroom OS X box that no one else got to use).
M
Re:Here's a handful of good CSS resources (Score:2, Informative)
Re:Learn online for free (Score:2)
I would. I keep going through monitors like crazy. IT says I'm not supposed to underline things with ballpoint on the screens themselves. Anyone have some soft #1 pencils they can send me?
Free? What about the time factor? (Score:5, Insightful)
When you need to get things done FAST, and learn while not in front of your computer monitor, or maybe even have a quickreference handy, you need to buy books. Hey, what if suddenly your internet connection drops?
I'm a customer of Sitepoint (the company that published the book), and I purchased the "build your own... website using PHP and MySQL". I keep it always handy on my job desk.
Also, having a manual handy (either printed or downloaded, such as the PHP reference) saves you lots of trouble. I've talked with many people who just use the online PHP manual, and they keep asking me stupid questions they could have answered themselves had they downloaded the reference in CHM format.
Never forget that time is money, and learning online "for free" might cost you lots of hours that you could have well spent designing a website and getting paid.
Re:Free? What about the time factor? (Score:1, Informative)
When you need to get things done FAST, and learn while not in front of your computer monitor...
Um, this is CSS we're talking about, there's no use for CSS when you're away from your computer. The only time a book is better is in a meeting, when someone asks if such-and-such is possible with CSS...
Hey, what if suddenly your internet connection drops?
As already mentioned, download useful websites to your local computer.
Never forget
How is your non-sequiter insightful? (Score:2)
How do you make the inference that books are faster? Can you search a book with Ctrl+F? Care to take a bet that my Ctrl+F is faster than your index?
I like it.... (Score:5, Interesting)
Good review, but... (Score:5, Insightful)
Re:Good review, but... (Score:4, Insightful)
Sure, I *want* to create a well designed site, but until I get that knowledge (school) it just ain't going to happen (not for me, anyway).
> I work quite comfortably on both sides of that fence
It's easy to say that about yourself, sure I even would try to claim that one. But when I look at sites I have created and compare them to sites done by a *real* graphic designer (web designer), there *is* a huge difference.
I'd consider myself a professional programmer and an amatuer designer at best.
Re:Good review, but... (Score:3, Insightful)
Re:Good review, but... (Score:2, Insightful)
Not to raise the hair on your back, but I wouldn't call any of those sites "good design". While they might be very usable and well-structured (not the markup), it doesn't take long to realize that they weren't created by somebody with a background in graphic design. Just compare to any of the sites in the CSS Va [cssvault.com]
Re:Good review, but... (Score:2)
And, most of the time, user interface issues should not be solved with the most CREATIVE solutions, but rather with the most PEDESTRIAN solutions. Users shouldn't find any surprises in the interface of your site or application -- it should look and feel just like all the other sites a
Re:Good review, but... (Score:2)
I'm confused. How on earth do you get "bad interface design" from "creative solutions? I never even mentioned interfaces, I was talking in general terms about design. In any case, a rennaissance ma
Re:Good review, but... (Score:2)
Not really. The majority of UIs out there are plain awful, so the most pedestrian solution is usually a very bad one. Because each application presents different information, different types of information, different levels of detail, differently-sized data sets and different kinds of end users, each UI should be creatively designed to accomodate all of this variability. If you are
Re:Good review, but... (Score:2)
[...]
Back in the days of Leonardo DaVinci there was no Berlin Wall seperating technical and creative people...
I accept "coder" and "technical" as synonyms for the purposes of this discussion, but not "artist" and "creative."
Re:Good review, but... (Score:2)
Re:Good review, but... (Score:2)
Re:Good review, but... (Score:2)
CSS is annoying (Score:3, Interesting)
With...
It fits more with the philosophy that colors and other styles should be in once place and one place only. CSS follows that OK right now, that is, we can put all those things in the same document, but wouldn't it be great if the document itself adhered to the same principle?
That problem seems to me one of the biggest in CSS. It makes things cluttered, take up 10 times as much space as they otherwise might, and makes for an illogical thought process. The designer doesn't think: I'll go through each element in the page and make them blue, but rather: I want this this and this to be blue. Anyway, just a thought.
Re:CSS is annoying (Score:3, Informative)
a.blue, span.blue, div#back {color: blue;}
Of course, you don't really need a.blue and span.blue. A simple
Re:CSS is annoying (Score:5, Informative)
color: blue;
}
and have it apply to anything with a class="blue", or
a.blue, span.blue, div#back {
color: blue;
}
to explicitly declare them. The commas being key in this one.
Re:CSS is annoying (Score:2)
a.blue, span.blue, div#back { color: blue; }
which works just fine? I'm fairly new to CSS, but it seems to me it's missing CPP-like definitions to allow propagating colors and such into more complicated structures.
Re:CSS is annoying (Score:2)
What does that mean? Does the "Cascading" part of Cascading Style Sheets not cover that?
(Seriously, I'm not sure what you're asking)
Re:CSS is annoying (Score:2)
#define BGCOLOR red;
somewhere in a CSS and then be able to use
color: BGCOLOR;
at various places in the CSS file(s) rather than gathering everything together in one place like the parent example. Sometimes it can be a pain to find everything and if you have styles for an element other than "color:" it doesn't save space to write them all together.
Re:CSS is annoying (Score:2)
The intention of CSS is to seperate document presentation from document structure. While doing t
Re:CSS is annoying (Score:2)
Re:CSS is annoying (Score:1)
a.blue, span.blue, div#back { color: blue; }
Re:CSS is annoying (Score:1)
Re:CSS is annoying (Score:5, Insightful)
Name them for what they are, not what they look like. Somewhere down the road you'll be glad you did.
Re:CSS is annoying (Score:4, Funny)
On a similar note, a friend of mine worked at a large telco, where they were told that they had to #define all their constants (in C)... so they (others, not my friend) had code that said #define THIRTEEN 13. The number had to change later, of course...
The more things change, the more things stay the same :-)
Re:CSS is annoying (Score:2)
Re:CSS is annoying (Score:2)
You do realize that the punishment for inverting the truth values is dismemberment, right? Check out the following fragment:
Inverting those values instantly puts most C programmers on the wrong foot and makes your code fundamentally incompatible with any other code out there. Especially when that other code has the good sense of defini
Sometimes, sometimes not (Score:2)
This is good advice sometimes, but not all the time. I've designed lots of tables where the creative department says, "Use the gray box there," or "Use the red table there." Since I was writing a lot of reports, was I less wise to choose to name the class, "grayBox" and have all the reports use it rather than name each one of 14 reports by its proper name? As it turned out, no, it wasn't.
So I think the answer here is to use your best judgement. Som
Re:CSS is annoying (Score:2)
Almost there (Score:1)
color: blue;
}
Re:CSS is annoying (Score:2)
a.blue, span.blue, div#back {color: blue;}
It's on page 3.
Re:CSS is annoying (Score:3, Interesting)
I disagree.
What CSS *really* needs is variables. For example:
Having variables like this would cut down on a lot of the maintenance headaches that CSS can cause.
Re:CSS is annoying (Score:3)
If you want variables, use a language designed to work with variables to dynamically generate CSS. You have plenty of choices: PHP, ASP, Perl, Parrot, etc. ad nauseum.
CSS *should* be just a formatting language as formatting is what it does, and all of what it does. It's sad that we couldn't just have one end-all formatting language (HTML could have been better..) and that we had to extend it with other languages to make it more flexible, but now we've got something that works. Dynamic langu
Re:CSS is annoying (Score:3, Insightful)
Why introduce a whole new language into the mix if all you want to do is set some constants that can be used in your CSS.
Things like
so you can do
obviously that is trivial, but there are a number of occasions I have come across
Re:CSS is annoying (Score:2)
I, as a former web designer, believe that abstraction is a good policy, but only where it needs to be a policy. If I know I have a page that I want the colors to change
Re:CSS is annoying (Score:1)
You can put PHP into your CSS and have Apache send all CSS files through the PHP parser. Put this in an .htaccess file:
<files somefile.css> .css
AddType application/x-httpd-php
</files>
And your CSS like this:
<? $border_color = #ccc; ?>
div.foo { border: 1px solid <?= $border_color ?>; }
div.bar { border: 2px solid <?= $border_color ?>; }
But then it ends up not really being CSS then, dunnit?
Re: (Score:1)
yes there is a way, just backwards:CSS is annoying (Score:1, Interesting)
you can assign a set of attributes to multiple IDs and classes.
also remember that the "cluttered look" and extra space is not really such a bad thing. as long as the style sheet is external, "readability" and ease of use and editing is more important.
many people can make CSS do cool stuff, but few are using it properly - too many IDs, setting IDs when a class would suffice, using inline styles repeatedly, hacks and whacks with margins and negative padding to
Re:CSS is annoying (Score:2)
Re:CSS is annoying (Score:2)
color: blue {a.blue, span.blue, div#back}
You got it backwards.
a.blue,span.blue,div#back { color:blue }
Also, you can specify classes more than once in a stylesheet. I use this to separate my stylesheets in two: Operational (margins, positioning width, etc), and Presentational (color, border styles).
For example:
STYLESHEET A
#whatever, #somethingelse { border:1px solid; width:35%; }
STYLESHEET B
#whatever { border-color:#f00;border-style:ridge; }
#somethingelse { border-color:#0f0;border-st
CSS is not annoying, knowledge must be acquired (Score:2, Informative)
What people haven't mentioned (I didn't see anyway) is the fact that you can apply multiple classes to a single element. So you can have your "blue" class for blue colored text (although that is a very bad class name...think about if you change the color to green). So you can do...
color:blue;
}
font-weight:bold;
}
a{
text-decoration:none;
}
div#back{
border:1px so
Re:CSS is annoying (Score:1)
Re:CSS is annoying (Score:2)
terrible names? (Score:2)
I don't buy it. In my last job, I heard a lot of, "Use the gray box there" (as opposed to the red, green, or gold boxes which were used elsewhere). The box that surrounded the area was never indicatedt o be "important," or regarding an "author" or "defintion." They wanted it to be gray.
So what's wrong with
in this case? I caught a lot of the, "Always use semantic class names or t
Re:terrible names? (Score:2)
It helps if the semantic approach is used from the beginning. If you're in a maintenance position where site components are already defined by their color rather than their meaning, then there's not much you can do about it
I think you're arguing for me, not against me (Score:2)
Exactly my point. I think that the decision to use the semantic approach from the beginning is a *religious* decision, not a *technical* decision.
is gold new stuff? Does red indicate breaking news?
Those types of questions didn't apply in this case. In some cases, the red looked better than the gold. It's just the color of the box and doesn't necessarily have to imply anything else than what just happens to look good with the other colors
Re:I think you're arguing for me, not against me (Score:2)
Perhaps ... but I've been in the position of having to re-approach old markup numerous times, and it's pretty much always been a lifesaver to have consistent, meaningful style rules. Actually, one of the best bits of advice I've yet seen on CSS is to take it one step further, and have separate stylesheets that control font, color, and layout. I've found this to be significantly
Re:I think you're arguing for me, not against me (Score:2)
I think you're taking it far too seriously. It seems that those who advocate the religion of not naming anything according to how it looks take on faith that every bit of every class will change nine million times every single week, so everything must be named abstractly to the 9 millionth degree.
No problem (Score:2)
In which case I would have changed
into
I know this happens to violate the "don't name classes in the Evil Way" rule, but seeing as how millions of babies and kittens would NOT die from this decision, I don't feel so worried.
Then your HTML that says div id=grey" will be used to display a blue table. It's not a threat,
Re:CSS is annoying (Score:2)
Re:CSS is annoying (Score:2)
Re:CSS is annoying (Score:1)
Are you saying we should live with poor standards because they are already established and it is too hard to change now? I don't see why HTML counterparts cannot slowly be added to the standard without busting backward compatibility.
But I am still curious on why they did not ask those kinds of questions back then. Does anybody have
Re:CSS is annoying (Score:1)
Okay, but do we have to use an entirely different syntax to acheive that? For example, create something called Style Markup Language using XML. I am not necessarily challenging the integration level here, but the syntax choice. We can separate the concepts without adding Yet Another Web Language syntax to the alrea
Re:CSS is annoying (Score:2)
CSS predates XML (IIRC).
Why break backwards compatibility? And there is XSL [w3.org] if you need XML. I suppose one day it will replace CSS but things move slowly in the name of backwards compatibility).
We need to go back to S-Exps ;)
Re: (Score:1)
Re: (Score:1)
Re:CSS is annoying (Score:1)
I argued in a sister thread that seperating the concepts is an orthogonal issue to using different syntaxes for a language.
Re: (Score:1)
Re: (Score:1)
CSS? (Score:3, Funny)
Re:CSS? (Score:2)
Re:CSS? (Score:2, Funny)
CSS W3C Standard (Score:3, Informative)
CSS 2.1 Specification [w3.org]
If you want to see the upcoming CSS 3 standard, or learn more about CSS, you can go here:
http://www.w3.org/Style/CSS/ [w3.org]
Re:CSS W3C Standard (Score:2)
No need to bother yourself with that, as it won't become viable until Longhorn 2.0 ships in 2013.
CSS virgin (Score:5, Funny)
CSS virgin
Would that be someone who:
Re:CSS virgin (Score:2)
CSS books? (Score:3, Funny)
Ooooh, that scary markup (Score:4, Funny)
If you're "scared" of mere markup, I would hate to see your actual coding.
Markup, my eye! (Score:2)
Calling CSS "markup" is disingenuous at best. I think the reason why said "markup" is frightening to programmers is because it is necessarily replete with obscure logic and pretends as hard as it fucking can that it doesn't have any logic within it and there is NO CLEAN WAY TO DEBUG IT.
CSS is as friendly to programmers as a circular saw is to a man's penis.
Why I hate CSS (Score:3, Interesting)
I'll leave aside whether it's a good idea to have a dynamic web page made up of three *different* scripting systems in one document, and just go on to mention two of the things that bug me most:
Firstly, it does not seem to be possible (unless I just haven't found it yet, please feel free to correct me) to say that I want style FOO to be the same as style BAR except with these changes. i.e., true hierarchical styles. Any word processor worthy of the name supports this. It allows you to make sure that each important style property is defined in exactly one, central place.
Secondly, CSS' styling system is very, very limited. How do you say, I want this container to be big enough to fit this string into? You can't. This means that any kind of layout where you have sized objects with text in them --- such as columns, or a header --- has to be specified in fixed values. You can't say, I want a graphic followed by a line of text followed by something that fills all the rest of the space. (You've got ems and ens and points but frankly, they're not useful.)
I do think that CSS is currently the best thing around for formatting HTML; I've also used it with moderate success for formatting raw XML. It just makes me cringe when I think how good it could be, and how lousy it actually is... I keep having this urge to write my own formatting engine in Javascript, and that's never good.
Maybe you should read a book / the spec (Score:4, Informative)
Firstly, it does not seem to be possible (unless I just haven't found it yet, please feel free to correct me) to say that I want style FOO to be the same as style BAR except with these changes.
What?? It is called Cascading Style Sheets for exactly that reason, it cascades!
Secondly, CSS' styling system is very, very limited. How do you say, I want this container to be big enough to fit this string into? You can't.
Big enough to fit what string? A container can fit any string with a proper overflow property.
This means that any kind of layout where you have sized objects with text in them --- such as columns, or a header --- has to be specified in fixed values.
This is simply not true. It is fairly simple to generate tabular layouts using pure CSS (that is what display:table-row and whatnot are for!)
You can't say, I want a graphic followed by a line of text followed by something that fills all the rest of the space.
Try this:
Seriously man.. CSS has lots of limitations (some of which will be addressed in V3, some of which aren't), but nothing like what you are spewing. I really suggest you read up some on the spec before you start bashing it so hashly.
Re:Maybe you should read a book / the spec (Score:2)
<div class="foo bar">This has red bg color with blue fg color.</div>
You sir, are my favourite person right now - I've been looking for this for years (even remember trying 'class="foo,bar" at some point; so close)! Now can someone tell me why not a single CSS tutorial/reference out there mentions this?
I'd still like to be able to do this in the
I believe he was requesting (Score:3, Insightful)
and that applying <div class="bar"> would then set the bgcolor to red and the fgcolor to blue. In your example you still have to remember that
Re:I believe he was requesting (Score:2)
Doesn't this do exactly what you want?
Re:Maybe you should read a book / the spec (Score:2)
Re:Maybe you should read a book / the spec (Score:2)
If done correctly and with foresight you can design complete a CSS layout which can be completely modified at a later date without a single change to your (X)HTML code. This isn't trivial, as it is hard to know for certain what changes you may want in the future.
The typicaly scheme which I use on my rather simply laid out website (monsterden.net [monsterden.net]) is basically to divide the code up into chunks using divs, and assign IDs or
Re:Maybe you should read a book / the spec (Score:2)
For XML? Well, Table tags don't work there, do they?
That's the point, and half the power of CSS.. you can write a simple style sheet, and apply it to an XML DOC that you got from Excel or OpenOffice or whatever, and have it appear pretty.
Re:Maybe you should read a book / the spec (Score:3, Insightful)
I didn't know about that; useful, although not quite what I'm looking for. Ta.
(The thing I object to here is that it requires the HTML content to have detailed knowledge of the mechanism of the markup, which is evil --- there's no need for the content to have to state that that particular div is a foo and a bar. It should just be able to state that it's a bar. The relationship to foo should be in the style sheet.)
Big enough to fit what string? A container can fit any string
Re:Maybe you should read a book / the spec (Score:2)
Your logo is "cowlark.com" in text. Thats 11 elements(characters). You can just set the size as 11em, and the browser figured out how much 1em is based on the size of the font.
Re:Maybe you should read a book / the spec (Score:2)
Actually, an em is the height of the font, from the lowest descender to the highest ascender. (It used to be the width of the letter 'M' in that font, hence the name --- you'll never guess what an en is.)
This means that 11em is going to be roughly the width of:
MMMMMMMMMMM
Which is much longer than my logo, in a proportional fon
Re:Why I hate CSS (Score:2)
Most of the problems probably come from rendering issues not spec issues....
Try working with SVG for a while and be happy for basic CSS+HTML
CSS in IE (Score:2)
There's a little script [sourceforge.net] I found that I use on my web page [maihem.org], though I know it doesn't all quite work, but then Windows users can all go install Firefox.