Besides the more obvious reasons for not using them (if no reasons come to mind, stop reading and go play some place on YouTube), in-line styles suck on another level. Here it is: you style that little div with an in-line style and then gets plopped into some code-behind nugget to get spit out later some place (reusable, right?) Dammit, I don’t want it styled like every time it gets spit out, and now I can’t modify it because I don’t have a ‘hook’ (of course I can, I just have to find where it’s getting generated and fix it there by giving it a class/id.) For example, if I’m reusing your code and you have an in-line style to right align the text, then the code I’m working on spits that out – it will be right aligned. However, if you gave that guy an id/class, I could left align it in a style sheet override (using the parent container in my selector because I am using it in a different parent now.) See here:

SUCKS

<div style="text-align:right;">Here I am.</div>

WAY BETTER

<div id="dvWhereAreYou">Here I am.</div>

See how it’s better? Now when I’m doing some voodoo later and generating that output with code-behind or even Javascript (gasp!), I can control it because it has an id. That is all, thank you!

similar stuff: