Great topic.
At some point, you have to face the fact, as I did, that you can’t really work on a web site without a very solid notion of how CSS works. Trying to make things look right in HTML is hopeless, and trying to do so with a weak understanding of CSS is almost worse. It can eat up hours and hours of your time as you flounder around trying things that don’t work and watching your beautiful design get trashed in one browser or another.
So, my advice to beginning web developers is to learn two things well: CSS and FireFox’s FireBug add-on.
I found this book immensely helpful:
http://www.amazon.com/CSS-Missing-David-Sawyer-McFarland/dp/0596526873 for really understanding CSS.
Once you have it, install FireBug and start looking at web sites with it. Just click on the Inspect button (the little rectangle with the arrow in it at the lower left). When you hover over a page element, FireBug will show you exactly which CSS rules are controlling its look and placement (and which rules are over-ridden by which other rules). This will cut the time takes to solve CSS problems by a factor of 10 (at least) and help you understand CSS at the same time.
Another valuable step, if you’re using MODx, is to get at least some understanding of PHP. It’s not rocket science, and there are a number of good sources on the web and some excellent books (read the reviews at Amazon and find one that meets your needs).
If you want to learn PHP, one thing is essential (and I can’t stress this enough): a good code editor.
*Do not*, under any circumstances, try to learn PHP by editing snippets in the MODx Manager. It will take forever, and you’ll end up hating PHP, MODx, and probably life itself.
A good code editor will show you your mistakes as you type them instead of letting you see an incomprehensible PHP error when you run the snippet. NetBeans is an excellent open-source editor. I’ve used NuSphere’s PhpEd for some time and it’s also quite good, but I’ve recently converted to JetBrains PhpStorm, which is astoundingly helpful for coding (though not free). Any good editor will also include CSS and HTML editors as a bonus.
When you write a snippet for modx, just put this for the snippet code in the Manager (make sure the snippet is called uncached !):
<?php
return inlude "path/to/your/file";
Then create a php file at that location and edit it with your code editor and have MODx open in another window to test the results.
You might think that a good code editor is only useful for experienced coders who need the advanced feature that are wasted on beginners. To the contrary, beginners need the editor’s help more than anyone. Even an average code editor will highlight your errors. The better the editor, the more intelligent the highlighting is. PhpStorm, for example, will put a little red squiggle at the point in a line of code where it thinks your problem is, and it’s usually right. If you’ve forgotten the semicolon at the end of a line, it will will put it there. If you’ve forgotten to close a quote, it will highlight the unmatched quote in pink. If you forget to put a dollar sign at the beginning of a variable name, it will tell you. It will alert you if you misspell a variable name, warn you if you use a variable that you haven’t set a value for, and even warn you if you set the value of a variable but don’t use it later in the program. If there are any PHP errors at all in the file, it will underline the filename at the top of the screen in red and you’ll know that there’s no point in trying to run it. As you might imagine, this not only saves you a *ton* of time, it also makes working on the code (or learning PHP) infinitely more pleasant and rewarding.
I will get off my soapbox now.