blogherald.com — I’ve been writing CSS for about 2 years now and I still feel like every time I open up a blank file and begin writing CSS for a new design I learn something new.For those of you that are new to CSS or experts always looking for a new trick, here are some of things I do on a regular basis to keep my code organized (kind of).
Sep 9, 2006 View in Crawl 4
mikesd34Sep 10, 2006
Zeeneo: Camel Caps is a developer style, of which there are many, some people prefer underscores, some camel caps, try to use what works best for you. That may mean trying both for a while, and seeing what you like best, rather than just going on what someone else said. A lot about learning to write code ( or CSS/HTML ) is trial and error, maybe not as much later in life when you've become adapted to it, but when you start it's good to get a taste of everything.
sakuyasloveSep 10, 2006
www.coderwiki.com
inkswampSep 10, 2006
Most of this advice seems like common sense to me, but this one irked me a bit...> Stop using so many divs!Why? Man, I hate this purist attitude toward the Web. If you want rules that are cast in stone, go into paper and ink publishing which has been around long enough for the rules to have solidified. If you can't handle a little anarchy in your life, stay away from Web coding. I know coding efficiency and standards are important but fercrissake, the Web isn't done evolving yet. It's been around for a while, but do we want it to freeze where it is or accept a little uncertainty in exchange for some progress?And besides, a div is just an empty container. If you need it, use it. What's the problem?
andrewthriceSep 10, 2006
Nice rant. He was mostly referring to using the div element for, say, a heading when heading elements, h1-h6, already exist. Use existing, semantic elements rather than rolling your own.
apersaudSep 10, 2006
True, #2 I think is the most important one for me (indenting by grouping by tags). I wish applications such as Macromedia Dreamweaver would do this automatically so when you actually look at the code, you can find your CSS tags much easier (and structured better). I've seen a lot of nasty CSS..
dotdanSep 11, 2006
Chongo, the problem with that is, whenever part of your HTML changes, you have to move or update your CSS. By listing it alphanumerically, you can modify your HTML without ever needing to touch the CSS.
silverrocketSep 15, 2006
Sorry, that should say "... in a redefined BODY definition". That's where I usually set all my page-wide settings?
adamseeSep 21, 2006
Because it saves coding space. If you collapse all the margins and paddings to 0 for all elements, you don't have to keep doing it elsewhere.
Closed AccountMar 20, 2007
<a class="user" href="http://www.design-sites.net">http://www.design-sites.net</a>
sosidsysApr 2, 2009
good, thanks! will help beginners! <a class="user" href="http://www.fitnes-peter-klepec.com/">http://www.fitnes-peter-klepec.com/</a><a class="user" href="http://www.ecros.biz/ecros_catalogues.html">http://www.ecros.biz/ecros_catalogues.html</a>