The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Nah, I wouldn't make a grave assumption like that...
Anything that is unrelated to elephants is irrelephant Anonymous - The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944 - Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
Specifically, I sometimes break out the CSS to represent specific style attributes, used like this:
<table class='noborders fixed fill'>
and sometimes I lump a bunch of attributes into on CSS, used like this:
and sometimes its a mishmash, used like this:
<div class='preview h100p'>
The only rhyme or reason is that some CSS styles are reused, like "h100p" (height 100% if you want to know), and some are specific to the container.
Obviously, I could create a style for each tag that contains all the style attributes, but that rather blows CSS re-use out of the water.
So what do you do? Do you have any guidelines you live but won't die by?
And while we're at it, how often do you actually use the "C" part of CSS -- cascading? I've come to avoid that aspect like the plague because as soon as I change something in the layout, the cascading element/class/id structure changes, and I have to go back and fix the CSS. The rare exception is when the container and its children need to always be moved as a unit. You're experience?
I basically do the same thing, if it's only going to be used in a certain place and only once I do inline but if it's used more than once I put it in a css file.
I also have a bad habit of putting a style link at top of html page "temporarily" for testing and end up leaving them there until I go back and clean up.
1. A person that fixes stuff you can't.
2. One who does precision guesswork based on unreliable data provided by those of questionable knowledge.
It starts out well, and works for the most part, but with larger applications it quickly gets messy and it's too easy to change something by mistake.
The truth is, I find CSS to be a massive headache to keep organised, and I am surprise Visual Studio have never added better tools for managing a CSS file or at least try to encourage a specific standard.
The bottom line is, I don't think anybody really knows how it's supposed to be done. We just make do and hope nobody asks for too many changes!
Bulk classes to control a lot of styles at once.
Trees, styles subordiante to an top-level style (like td and td automatically for a given table)
Mini classes to control very specific attributes (bold, center, shadows, position, etc)
and sometimes the latter to modify the former two - and even inline style='' for some final touches if needed
So - pretty much the same. The final tweaks are much more often for functionality than esthetics.