The Most Active and Friendliest
Affiliate Marketing Community Online!

“Propeller”/  MyBid

Still Using Inline Styles?

espmartin

New Member
affiliate
I absolutely love CSS, and before I learned about semantical
standards (separation of content from presentation), I used
inline styles heavily. But once I got the fact that external
cascading style sheets made life a whole lot easier when you
had to make style changes sitewide, I stopped using styles inline.

How many of you could benefit from externalizing your style rules?
 
With you all the way not using inline styles, i believe the sitening seo tool marks down your websites grade if you use them, will have to check.

In my eyes its far easier editing a simple css file rather then masses of markup code on your VALID html pages :D
 
Every once in a while if I need to edit single element on single page I may use inline style but 99% of the time it's external styles
 
I/m the same as SkinnerW, I use external CSS almost exclusively. If you style using classes, it can sometimes be better to have a simple inline style to customise a single element by modifying an existing class that almost fits rather than create a whole new class.
 
Sometimes, mostly when the site is huge I use inline css, but this is not so general. I rather place the style control lines into external css and javascript files.
 
I have a nasty habit of putting inline styles in while I'm developing and then having to go back through and move them somewhere external afterwards!!!
 
I have a nasty habit of putting inline styles in while I'm developing and then having to go back through and move them somewhere external afterwards!!!

im exactly the same... how lazy are we.. ive got to get out the habit but its just sooooo much work flipping to another tab!!! lol

but then im the only developer where i work so i can kinda afford to be a tad lazy as i havnt got another developer having ago at me for using inline css
 
Well i would say its fine for testing purposes, as well as single situations. Sometimes its simply more practical to use the style attribute.

I often use inline styles when testing new styles, and it can take quite some time for me to add them to the stylesheet.


One thing to remember however, using inline styles wont have any effect on your placement in the search engines like some beginners suggest, they often also claim xhtml to improve your ranking which simply isn't true.

So when practical use inline styles, and avoid a cluttered css file with styles that only effect a few situations on your page.


Clearing floats would be fine to do inline, but you could alternatively have a clearing class, if you ain't the only one working on the layout, and/or if your site where to support more then one layout through stylesheets.


Also keep in mind that external stylesheets are cached by the browser, embedded and inline styles ain't.
 
Last edited:
In some cases I have not been able to achieve the functionality I want without using an inline style... I try and stay away as much as possible though.
 
haha that's funny, I am guilty of the same thing. Only after I have got the exact styles that I want, do i go back and cut out the inline stuff and make classes in an external. Old habits die hard, right?
 
I'm the same - I often develop my code with CSS inline (this is particularly helpful when you're working on AJAX). Then move them out to a separate CSS file afterwards. The only time I leave inline styles in place is when they're required for the scripting I'm doing - when working with a javascript effects library like scriptaculous; I'll often find that I have to leave the styles inline in order to have Javascript modify them on the fly.

It's worth noting why we have external stylesheets in the first place - it speeds load times for your pages. Once your stylesheet is loaded for one page, it doesn't then have to be re-downloaded for subsequent pages, which means that your HTML files are smaller, so less to download.
 
banners
Back